Source Code:
(back to article)
import pandas as pd # create an empty DataFrame df = pd.DataFrame() # add data to the DataFrame df['name'] = ['John', 'Jane', 'Bob'] df['age'] = [30, 25, 35] df['city'] = ['New York', 'Los Angeles', 'Chicago'] print(df)
Result:
Report an issue