0% found this document useful (0 votes)
2 views9 pages

DataFrame 2

The document provides an overview of DataFrame operations in Python, including reading CSV files, basic functions, sorting, aggregation, and group by operations. It highlights specific functions such as df.shape, df.isna(), and df.groupby(). Additionally, it mentions how to save subsets of data and find average prices for car types.

Uploaded by

infaiics20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

DataFrame 2

The document provides an overview of DataFrame operations in Python, including reading CSV files, basic functions, sorting, aggregation, and group by operations. It highlights specific functions such as df.shape, df.isna(), and df.groupby(). Additionally, it mentions how to save subsets of data and find average prices for car types.

Uploaded by

infaiics20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DataFrame Operations

.
read_csv function
Remember that in python “\” (Backslash is escape character)
Eg. (‘\n’,’\t’)

Copy as path in windows

Paste the path in notepad

Copy path from notepad with Ctrl+C( Copy)


Paste the path in juputer notebook Paste Ctrl+v (Paste)
Basic functions in dataframe
 [Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]().sum
df.value_counts()
[Link]
Saving subset values in different
dataframe
A = pd.read_csv(‘Path’)

B = A[[‘column1’, ‘column2’, ‘column3’]]


Sorting values in dataframe

A = df.sort_values(by=‘columnName’)

A = df.sort_values(by=[‘column1’, ‘column2’])

A = df.sort_values(by=[‘column1’, ‘column2’], ascending=False)


Aggregation operations in a dataframe

[Link]()

[Link]()

[Link]()

[Link](), [Link]()
Group by operations
[Link](by = ‘columnName’).count()

[Link](by = [‘column1’, ‘column2’]).sum()

[Link](by = [‘column1’, ‘column2’]).mean()


Find out cars types with average price
less than 20
Thank you
PING ME ON SKYPE GROUP IF YOU HAVE ANY QUERIES

You might also like