view raw
Dreamer Dreamer - 6 months ago 44
Python Question

Convert series to other format using pandas

I have a data frame df with a column

, which is a series of values like:

0 Brian
1 Natasha
2 Mike
3 Anthony
4 Steve

I want to convert this in below format:


How do I perform this task using pandas?


Pandas Series have a tolist method.