Sayth Renshaw wrote:
> Peter Otten wrote:
>> def explode_consultants(consultants):
Should have called that split_consultants(); takes a string and
>> consultants = (c.lstrip("#") for c in consultants.split(";"))
splits by ";", removes leading "#"
>> return (c for c in consult
>
> Since I didn't find a cool shortcut I decided to use brute force:
>
> $ cat pandas_explode_column.py
> import pandas as pd
>
> df = pd.DataFrame(
> [
> [
> "2019-06-21 11:15:00",
> "WNEWSKI, Joan;#17226;#BALIN, Jock;#18139;#DUNE, Colem;#17230;"
>
Sayth Renshaw wrote:
> Hi
>
> Having fun with pandas filtering a work excel file.
> My current script opens selected and filters the data and saves as excel.
>
> import pandas as pd
> import numpy as np
>
> log = pd.read_excel("log_dump_py.xlsx")
> df = log.filter(items=['Completed', 'Priority'
Update.
Option 1. - This annihilates all text in the column leaving nothing.
completed_tasks['Consultant'] =
completed_tasks['Consultant'].str.rstrip('.#123')
Option 2. - returns unhashable series list.
output =
completed_tasks[completed_tasks['Consultant']].str.contains(r'/\b[^\d\W]+\b/g')
> > NB. There are varied amounts of consultants so splitting across columns is
> > uneven. if it was even melt seems like it would be good
> > https://dfrieds.com/data-analysis/melt-unpivot-python-pandas
>
> Keep it simple: https://docs.python.org/3.6/library/string.html
>
> --
> Regards =dn
On 26/06/19 6:13 PM, Sayth Renshaw wrote:
Hi
Having fun with pandas filtering a work excel file.
My current script opens selected and filters the data and saves as excel.
...
This leaves me with a set of several columns. The main column of concern for
this example is a consultant
Session date