pandas split and melt()

DL Neil PythonList at DancesWithMice.info
Wed Jun 26 02:29:59 EDT 2019


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	Consultant
> 2019-06-21 11:15:00	WNEWSKI, Joan;#17226;#BALIN, Jock;#18139;#DUNE, Colem;#17230;
> 
> How can I split the consultant column, keep only names and drop the numbers and for every session date create a line with data and consultants name?
> 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



More information about the Python-list mailing list