Using regular expressions to pull information out of a column, remove it from that column, and put it in a new one with Pandas
- pandas str extract and remove
There’s got to be a better way to do this, but here’s what i’m doing:
- python cast to int
That’s simply int(something)
but i did not end up using that.
-
python concat
-
pandas add string to all values of column
-
pandas str replace from series
-
pandas str replace frame re.sub
-
pandas substitute text two columns
-
pandas substitute string from series
-
pandas replace part of column with another column
As my commit message said:
OK wow lot harder to remove value from column than expected
timelog['description'] = timelog.apply(lambda x: x['description'].replace(x['tmp_timeshift']), axis=1)
- pandas date add
https://datagy.io/pandas-add-days-date-column/
Corrected these warnings:
- pandas datetimelike PerformanceWarning: Adding/subtracting object-dtype array to TimedeltaArray not vectorized
- FutureWarning: The default value of regex will change from True to False in a future version. In addition, single character regular expressions willnot be treated as literal strings when regex=True.
https://github.com/pandas-dev/pandas/issues/24804#issuecomment-455265456
See https://gitlab.com/agaric/python/parse-timelogs-for-upload/ for pretty much anything i was doing with Pandas and bulk series input data manipulation.