Skip to content

Instantly share code, notes, and snippets.

@umarhussain88
Last active April 20, 2021 12:58
Show Gist options
  • Save umarhussain88/4dc5a24041581990874c18c513003096 to your computer and use it in GitHub Desktop.
Save umarhussain88/4dc5a24041581990874c18c513003096 to your computer and use it in GitHub Desktop.
df = pd.read_csv('GlobalLandTemperaturesByCountry.csv')
df = df.dropna(subset=['AverageTemperature'])
df['dt'] = pd.to_datetime(df['dt'])
df = df[df['dt'].dt.year >= 1900]
df = df.drop(['AverageTemperatureUncertainty'], axis=1)
df_group = df.groupby(dfRead['dt'].dt.year)['AverageTemperature'].mean().reset_index()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment