7.3. Dafaframe in Python
7.3. Dafaframe in Python
Features of DataFrame
• Potentially columns are of different
types
• Size – Mutable Data
• Labeled axes (rows and columns)
• Can Perform Arithmetic operations on
rows and columns
Index
Create a Data Frame with pandas
pandas.DataFrame( data, index, columns, dtype, copy)
import pandas as pd
data = [['Alex',10],['Bob',12],['Clarke',13]]
df = pd.DataFrame(data,columns=['Name','Age'])
print df
df[1:4]
df.iloc[1:4]
Operation: addition of rows by .append
Operation: deletion of rows by .drop