I'm a beginner to Python (Jupyter notebook) I'm added my code and I'm not sure my code is correct becacue always my result is here
The average relative humidity is: nan%any solution to resolved this?
contains hourly weather observations
my output answer here:The average relative humidity is: nan%
My csv file here : weather_2021-12.csv
| Abbreviation | Meaning |
|---|---|
| TA | Temperature Average |
| RH | Relative Humidity |
| WS | Wind Speed |
| WD | Wind Direction |
| PRA | Precipitation Amount |
| PRI | Precipitation Intensity |
| PA | Pressure Average |
| WAWA | Most Significant Weather Code |
Calculate the average relative humidity over the full timespan covered in the data, dropping any NaN values.
Please also write a separate report (Jupyter notebook)
import pandas as pd data = pd.read_csv(r'C:\Users\Dataset\weather_2021-12.csv')average_relative_humidity = data[data['ParameterName'] == 'RH']['ParameterValue'].dropna().mean()print(f'Average Relative Humidity: {average_relative_humidity}')
Thanks in advance