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
import pandas as pd
data ={"Name":['Phillip','Donald','Fankhola','Mixo','Delight','Vuyo'],"Surname":['Moyo','Phutiane','Siphotoma','Ngobeni','Chauke','Shabango'],"Age":[25,23,24,24,23,23]}
df = pd.DataFrame(data)
df
# Python code demonstrate creating# DataFrame from dict narray / lists# By default addresses.import pandas as pd
# initialize data of lists.
data ={'Name':['Tom','nick','krish','jack'],'Age':[20,21,19,18]}# Create DataFrame
df = pd.DataFrame(data)# Print the output.
df
import pandas as pd
data ={"Name":['Phillip','Donald','Fankhola','Mixo','Delight','Vuyo'],"Surname":['Moyo','Phutiane','Siphotoma','Ngobeni','Chauke','Shabango'],"Age":[25,23,24,24,23,23]}
df = pd.DataFrame(data)
df
import pandas as pd
data ={"Name":['Phillip','Donald','Fankhola','Mixo','Delight','Vuyo'],"Surname":['Moyo','Phutiane','Siphotoma','Ngobeni','Chauke','Shabango'],"Age":[25,23,24,24,23,23]}
df = pd.DataFrame(data)
df
import pandas as pd
# initialise data of lists.
data ={'Name':['Tom','nick','krish','jack'],'Age':[20,21,19,18]}# Create DataFrame
df = pd.DataFrame(data)# Print the output.
df
# Import pandas libraryimport pandas as pd
# initialize list of lists
data =[['tom',10],['nick',15],['juli',14]]# Create the pandas DataFrame
df = pd.DataFrame(data, columns=['Name','Age'])# print dataframe.
df
# Python code demonstrate creating# pandas DataFrame with indexed by# DataFrame using arrays.import pandas as pd
# initialize data of lists.
data ={'Name':['Tom','Jack','nick','juli'],'marks':[99,98,95,90]}# Creates pandas DataFrame.
df = pd.DataFrame(data, index=['rank1','rank2','rank3','rank4'])# print the data
grouped = df.groupby(['class','avg calories per unit'])
grouped
# Python code demonstrate creating# pandas DataFrame with indexed by# DataFrame using arrays.import pandas as pd
# initialize data of lists.
data ={'Name':['Tom','Jack','nick','juli'],'marks':[99,98,95,90]}# Creates pandas DataFrame.
df = pd.DataFrame(data, index=['rank1','rank2','rank3','rank4'])# print the data
df