Thursday, May 2, 2024

BCA PART B 11. Create DataFramefrom Excel sheet using Pandas and Perform Operations on DataFrames

 


import pandas as pd

# making data frame from csv file
df = pd.read_excel("nba.xlsx")

# printing the first 10 rows of the dataframe
df[:10]

# Applying aggregation across all the columns
# sum and min will be found for each
# numeric type column in df dataframe

df.aggregate(['sum', 'min'])

No comments:

Post a Comment