create and save dataframe to csv

PHOTO EMBED

Tue Jun 29 2021 16:21:45 GMT+0000 (Coordinated Universal Time)

Saved by @Quinn #py #dataframe #pandas

import pandas as pd

data = {'Product': ['Desktop Computer','Tablet','Printer','Laptop'],
        'Price': [850,200,150,1300]
        }

df = pd.DataFrame(data, columns= ['Product', 'Price'])

df.to_csv(r'Path where you want to store the exported CSV file\File Name.csv')

print (df)
content_copyCOPY