how to build pandas dataframe code example
Example 1: how to create dataframe in python
import pandas as pd
# intialise data of lists.
data = {'Name':['Tom', 'nick', 'krish', 'jack'],
'Age':[20, 21, 19, 18]}
# Create DataFrame
df = pd.DataFrame(data)
# Print the output.
df
Example 2: pandas make new dataframe
df = pd.DataFrame({'column1':[1,2,3],'column2':[4,5,6])