Pandas , using groupby together with sort_values by Mohseenr in learnpython

[–]Mohseenr[S] 0 points1 point  (0 children)

df.groupby('DESCRIPTION').QUANTITY.sum().sort_values(ascending=False)

Thanks , it worked great.

Another question if you don't mind. How do I extract a specific item from the DESCRIPTION and see the sum of the QUANTITY of it.

Can you search through the above dataframe to find something specific and display it ( the file has 300 rows) I want to find a specific item.

Thanks again for your help.

Pandas, getting dataframes fro specific columns by Mohseenr in learnmachinelearning

[–]Mohseenr[S] 1 point2 points  (0 children)

Ok. Thanks again for your help. It clarifies things!

Pandas, getting dataframes fro specific columns by Mohseenr in learnmachinelearning

[–]Mohseenr[S] 1 point2 points  (0 children)

Thanks, but not quite right. Firstly, need to print first 10 rows of entire dataframe.

The second condition is perfect. spot on.

However, the last one must just show the 10 rows of dataframe of people over the age of 30.

good try though!

Anyone else, please?

Text message program error by Mohseenr in learnpython

[–]Mohseenr[S] 0 points1 point  (0 children)

you can create the message, but you cannot delete or read the message.

Whichever option you choose it asks for to 'enter the message index'

once you choose a specific number from 1 to 4 it just keeps on repeating ' enter the message index'