Hello!
I was hoping to get some input on why my code is not working as intended. I want to produce the mean and median value of a Pandas series that contains the input from a previously read in Excel file, but I believe there is an error in my method. Any assistance would be much appreciated.
Here is my code:
I was hoping to get some input on why my code is not working as intended. I want to produce the mean and median value of a Pandas series that contains the input from a previously read in Excel file, but I believe there is an error in my method. Any assistance would be much appreciated.
Here is my code:
df = pd.read_csv('train.csv') id_values = pd.Series(df['PassengerId']) PassengerMedian = pd.Series.median(df['PassengerId']) PassengerMean = pd.Series.mean(df['PassengerId']) print(f"ID mean is {PassengerMean}; median value is :{PassengerMedian}") display(id_values)The problem is that as well as showing the values of PassengerId it says "ID mean is 446.0; median value is :446.0 ". Any hints on how to fix this? Cheers!