0

i have following code

dataframe = pd.DataFrame(data=records)
tabelle=dataframe.copy()
print(tabelle[["date","kw_search","impressions"]])   

with following results

         date                 kw_search          impressions
 0      2021-02-13           takoyaki pfanne          284
 1      2021-02-13  aluguss pfanne viereckig            6
 2      2021-02-13                b0775v4vqn            8
 3      2021-02-13                  eggs pan           80
 4      2021-02-13         tamagoyaki pfanne           45
 ...           ...                       ...          ...
 13535  2021-08-18                b09575d5kh          136
 13536  2021-08-18              honigspender           62
 13537  2021-08-18               waffeleisen           44
 13538  2021-08-18     yagdanlik ve sirkelik            3
 13539  2021-08-18      bluetooth nachttisch            1

i want to sort by values of impression:

dataframe = pd.DataFrame(data=records)
tabelle=dataframe.copy()
tabelle.sort_values(by=['impressions'])
print(tabelle[["date","kw_search","impressions"]])
cursor.close()
cnx.close()

but the result didnt change. it stays the same.

0

1 Answer 1

1

got the answer i forgot to set inplace=True code should be:

tabelle.sort_values(by=['impressions'],inplace=True)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.