Dreamer Dreamer - 1 year ago 99
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?

Answer Source

Pandas Series have a tolist method.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download