filmov
tv
Pandas DataFrame basic methods shape, head(), unique(), sort_values() and displaying records

Показать описание
Use basic methods of Pandas to show the rows and columns. Details questions and sample DataFrame is here
using shape
This will give number of rows and columns in the DataFrame.
Frist 4 rows of data
Number of rows using len()
Print(len(df))
Displaying all columns
Displaying first 5 records and name column
Print(df[‘name’][:5])
Displaying highest 5 records based on mark
Print(df[:5])
Displaying all unique class
print(df['class'].unique())
We can get number of unique class by using len()
#DataFramehead() #dataframebasics #dataframe #plus2net #pandas #datascience #pandastutorials
using shape
This will give number of rows and columns in the DataFrame.
Frist 4 rows of data
Number of rows using len()
Print(len(df))
Displaying all columns
Displaying first 5 records and name column
Print(df[‘name’][:5])
Displaying highest 5 records based on mark
Print(df[:5])
Displaying all unique class
print(df['class'].unique())
We can get number of unique class by using len()
#DataFramehead() #dataframebasics #dataframe #plus2net #pandas #datascience #pandastutorials