I am trying to wrap text at certain point e.g. |
in a cell and export that to html.
An example:
import pandas as pd
df = pd.DataFrame({'EmployeeId': ['157', '292', '643', '124', '355'],
'City': ['Mumbai|Bangalore', 'Pune|Mumbai|Delhi', 'Mumbai|Bangalore', 'Mumbai|Pune', 'Bangalore']})
print(df)
df.to_html('test1.html')
Output:
EmployeeId City
0 157 Mumbai|Bangalore
1 292 Pune|Mumbai|Delhi
2 643 Mumbai|Bangalore
3 124 Mumbai|Pune
4 355 Bangalore
I would have a html file like this (expected):
Output:
EmployeeId City
0 157 Mumbai
Bangalore
1 292 Pune
Mumbai
Delhi
2 ... ...
Any help will be much appreciated.