AppLIED Stats on Data Set Flashcards
How to know Total no. of rows nd columns in Data Set ?
We have to use shape attribute of data frame object .
df.shape
How to know Total no. of rows nd columns in Data Set ?
We have to use shape attribute of data frame object .
df.shape
How to sort Data Set by particular column ?
We have to use sort_value() method of Data Frame Object .
df.sort_values(‘column_name’,ascending=True)
How to find minimum & maximum value of column , column contains numeric values ?
We have to use min() & max() method of Data Frame Object .
df[‘Age’].max()
df[‘Age’].min()
How to use agg method ?
agg method is used for using multiple aggregate functions together on data Frame .
df.groupby(‘Embarked’)[‘Age’].agg([‘count’,’max’,’min’,’mean’])
How to get to know basic information of Data Set ?
index columns shape info() describe()
How to get column list of Data Set , & store it in variable?
columns=df.columns
How to create a data frame , using column as row index ?
We have to use index_col argument of read_csv method.
df = pd.read_csv(‘dataSets/titanic.csv’,index_col=3)