Generation

generate functionMon, 06 Feb 2023

There is a df_ru Pandas dataframe: date av_temp deviations country year decade 432393 1988-07-01 16.105 0.158 Russia 1988 1980-1990 432429 1991-07-01 16.385 0.243 Russia 1991 1990-2000 432489 1996-07-01 16.032 0.213 Russia 1996 1990-2000 432513 1998-07-01 16.677 0.183 Russia 1998 1990-2000 432525 1999-07-01 16.412 0.228 Russia 1999 1990-2000 432549 2001-07-01 16.539 0.190 Russia 2001 2000-2010 Write a function that will create a new dataframe hot_years and leave in it only those lines where av_temp > 12

df_hot_years = df_ru[df_ru["av_temp"] > 12]["year"] " print(df_hot_years)

Questions about programming?Chat with your personal AI assistant