Pandas DataFrame Basics: Shape, Head, Unique & Sorting

Learn essential Pandas DataFrame methods like shape, head(), unique(), and sort_values() to explore and display data effectively. 📊

Pandas DataFrame Basics: Shape, Head, Unique & Sorting
plus2net
1.2K views • May 13, 2021
Pandas DataFrame Basics: Shape, Head, Unique & Sorting

About this video

Use basic methods of Pandas to show the rows and columns. Details questions and sample DataFrame is here

https://www.plus2net.com/python/pandas-dataframe-exercise1.php
https://www.plus2net.com/python/pandas-student.php

using shape
print(df.shape) # ( 35, 5)
This will give number of rows and columns in the DataFrame.
Frist 4 rows of data
Print(df.head(4))
Number of rows using len()
Print(len(df))
Displaying all columns
Print(df.columns)
Displaying first 5 records and name column
Print(df[‘name’][:5])
Displaying highest 5 records based on mark
Df=df.sort_values([‘mark’],ascending=False)
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

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

1.2K

Likes

17

Duration

4:47

Published

May 13, 2021

User Reviews

4.4
(1)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.