I am brand new to Pandas and following along with a Plurasight course I have gotten stuck on how can I rewrite the following to use loc instead of chained indexing.
every_6th_row = pd.Series(range(5, len(df),6))
# can you rewrite this line to use df.loc
df['MIN_TEMP_GROUND'].drop(every_6th_row).isnull().all()
Within the dataframe there is only a value in the column MIN_TEMP_GROUND every six rows, so this statement checks to ensure that all the other rows are null.
I have tried a number of combinations such as:
df.drop(df.loc[every_6th_row, 'MIN_TEMP_GROUND'])
without success. Any pointers to where I am going wrong would be appreciated.