Feb-10-2020, 03:42 AM
Hello,
I am using Jupyer and SQL magic to create a dataframe from my query:
Is there a better approach to what I am trying to do? It doesn't make sense to me that I should create a copy of my new, filtered data frame to simply sort it..
I am using Jupyer and SQL magic to create a dataframe from my query:
df = query_from_magic.DataFrame()I then wanted to look at a sub-set of that data. In this specific example, I want to probe into a given date and then sort the results based on the integer stored in the 'count' column:
df_check = df.loc[df.date == '2020-01-28'] df_check.sort_values(by='count', inplace=True, ascending=True) df_checkI am getting the warning about SettingWithCopyWarning.
Is there a better approach to what I am trying to do? It doesn't make sense to me that I should create a copy of my new, filtered data frame to simply sort it..