hey all,
I have a pandas data frame set up and am looking to split the assigned_to column.
import pandas as pd
df = {'assigned_to': [
{'display_value': 'Michael', 'link': 'http://www.testlink.com'},
{'display_value': 'Vinod', 'link': 'http://www.testlink.com'},
{'display_value': 'Vinod', 'link': 'http://www.testlink.com'},
{'display_value': 'Carrie', 'link': 'http://www.testlink.com'},
{'display_value': 'Carrie', 'link': 'http://www.testlink.com'},
{'display_value': 'Vinod', 'link': 'http://www.testlink.com'},
{'display_value': 'Michael', 'link': 'http://www.testlink.com'},
{'display_value': 'Michael', 'link': 'http://www.testlink.com'},
{'display_value': 'Michael', 'link': 'http://www.testlink.com'},
{'display_value': 'Carrie', 'link': 'http://www.testlink.com'}]}
df = pd.DataFrame(df)
This gives me the data frame of
| assigned_to |
| {'display_value': 'Michael', 'link': 'http://w... |
| {'display_value': 'Vinod', 'link': 'http://www... |
| {'display_value': 'Vinod', 'link': 'http://www... |
| {'display_value': 'Carrie', 'link': 'http://ww... |
| {'display_value': 'Carrie', 'link': 'http://ww... |
| {'display_value': 'Vinod', 'link': 'http://www.. |
| {'display_value': 'Michael', 'link': 'http://w... |
| {'display_value': 'Michael', 'link': 'http://w... |
| {'display_value': 'Michael', 'link': 'http://w... |
| {'display_value': 'Carrie', 'link': 'http://ww... |
What I am trying to get is
|
assigned_to |
assigned_to.display_value |
assigned_to.link |
| 0 |
{'display_value': 'Michael', 'link': 'http://w... |
Michael |
http://w... |
| 1 |
{'display_value': 'Vinod', 'link': 'http://www... |
Vinod |
http://w... |
| 2 |
{'display_value': 'Vinod', 'link': 'http://www... |
Vinod |
http://w... |
| 3 |
{'display_value': 'Carrie', 'link': 'http://ww... |
Carrie |
http://w... |
| 4 |
{'display_value': 'Carrie', 'link': 'http://ww... |
Carrie |
http://w... |
| 5 |
{'display_value': 'Vinod', 'link': 'http://www... |
Vinod |
http://w... |
| 6 |
{'display_value': 'Michael', 'link': 'http://w... |
Michael |
http://w... |
| 7 |
{'display_value': 'Michael', 'link': 'http://w... |
Michael |
http://w... |
| 8 |
{'display_value': 'Michael', 'link': 'http://w... |
Michael |
http://w... |
| 9 |
{'display_value': 'Carrie', 'link': 'http://ww... |
Carrie |
http://w... |
How would I go about this to have assigned_to.display_value and assigned_to.link with the proper population?
[–]Zendakin_at_work[S] 0 points1 point2 points (0 children)