Skip to content Skip to sidebar Skip to footer

Filtering Based On The "rows" Data After Creating A Pivot Table In Python Pandas

I have a set of data that I'm getting from a SQL database and reading into a pandas dataframe. The resulting df is about 250M rows and growing everyday. Therefore, I'd like to pivo

Solution 1:

You should be able to slice it like so:

In [11]: pivot.ix[('2013-06-01', 3):('2013-06-01', 6)]
Out[11]:
                     views
report_date item_id
2013-06-01  5           16

See advance indexing in the docs.


Post a Comment for "Filtering Based On The "rows" Data After Creating A Pivot Table In Python Pandas"