Python Pandas – Sort, Sum, Count




[ad_1]

In this python pandas tutorial, we will go over the basics of how to sort your data, sum or get totals for parts of your data, and get counts for parts of your data.

Source


[ad_2]

Comment List

  • Ryan Noonan
    December 13, 2020

    this gave me just what I needed :). thank you!

  • Ryan Noonan
    December 13, 2020

    Hi Ryan, Is there a step involved in creating the variable called "states_data.groupby? Please help

  • Ryan Noonan
    December 13, 2020

    Thanks …nice video on sum and count..like it …

  • Ryan Noonan
    December 13, 2020

    I have a problem,

    import pandas as pd

    data = pd.read_csv(r'C:UsersDesktopholis.txt', sep=';', header=None)

    acomodarporentidad=data.sort_values(by=[1,0], ascending = True)

    sumaporentidad= data.groupby(1)[135].sum()

    I have 135 columns and i would like to some from the 75 to the 135. I don't know how to slice the data.

    I tried sumaporentidad= data.groupby(1)[75:135].sum()

    but it's not working

    Thanks!

  • Ryan Noonan
    December 13, 2020

    It can run without by= argument. Just the column header name would do ['Population']

  • Ryan Noonan
    December 13, 2020

    Please make more videos for python pandas, this one is good to understand

  • Ryan Noonan
    December 13, 2020

    Thanks for your video! 🙂

    While trying to sort by a column I get the following error:
    raise KeyError(key)
    KeyError: 'column name'

    Do you have any suggestion to solve it?

  • Ryan Noonan
    December 13, 2020

    Thank you very much, a very beautiful and important video.

Write a comment