I am trying to remove specific rows from the dataset and find the average of a specific column after the rows are removed without changing the original dataset
JavaScript
x
11
11
1
import pandas as PD
2
import NumPy as np
3
df = PD.read_csv(r"C:UsersUserDownloadsnba.CSV")
4
NBA = PD.read_csv(r"C:UsersUserDownloadsnba.CSV")
5
NBA.drop([25,72,63],axis=0)
6
7
I NEED TO FIND THE AVERAGE OF A SPECIFIC COLUMN LIKE "AGE"
8
9
HOWEVER THIS ISNT WORKING: Nba.drop([25,72,63],axis=0),['Age'].mean()
10
NEITHER IS THE QUERY COMMAND OR THE. LOC COMMAND
11
Advertisement
Answer
can you try this? I think there was a typo in your code
JavaScript
1
2
1
Nba.drop([25,72,63],axis=0)['Age'].mean()
2