How to convert a pandas dataframe into a python list, and a python list into a pandas dataframe?
1. To convert a pandas dataframe into a python list
email_list = df['Email'].to_list()
or
email_list = df[['Name', 'Email']].to_list()
2. To convert a python list into a pandas dataframe
Examples
No comments:
Post a Comment