Open Cxf461 opened 3 years ago
Hi,
I just found a guide (link here) that describes this fairly well. Pay particular attention to the section Select DataFrame Rows Based on multiple conditions on columns.
Does this help you?
Best, Joachim
Hey Joachim
I have tried to use your link together with this one: https://thispointer.com/pandas-find-maximum-values-position-in-columns-or-rows-of-a-dataframe/
I end up with this answer:
df_select = df_sub_weather[ (df_sub_weather["station"] == "ITE00100550") & (df_sub_weather["obs_value"].max())]
df_select
with the output:
can you explain what I am doing wrong her?
Best
Konstantin
Try and take a closer look at your dataframe (i.e. print different sets of rows with the iloc method). What values are contained in the row _obstype? What do these mean? And finally, how can you use this knowledge in the line of code above?
Best, Joachim
Thank you Joachim, I have figured it out!
Hi,
I do not know how to solve Ex. 0.4.3 as I do not know how to select ITE00100550 and maximum temperature with loc or iloc.
Should I just skip it, or can this be taught somewhere?