Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53394

Not getting my head around pandas

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!roy
From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Not getting my head around pandas
Date Sat, 31 Aug 2013 21:23:00 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Lines 25
Message-ID <roy-A6E29C.21230031082013@news.panix.com> (permalink)
NNTP-Posting-Host localhost
X-Trace reader1.panix.com 1377998581 20782 127.0.0.1 (1 Sep 2013 01:23:01 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sun, 1 Sep 2013 01:23:01 +0000 (UTC)
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Xref csiph.com comp.lang.python:53394

Show key headers only | View raw


I've got a pandas DataFrame that looks like:


<class 'pandas.core.frame.DataFrame'>
Int64Index: 12960 entries, 0 to 12959
Data columns (total 2 columns):
date    12960  non-null values
ms      12960  non-null values
dtypes: datetime64[ns](1), float64(1)


                     date         ms
12955 2013-08-30 23:20:00  96.868491
12956 2013-08-30 23:30:00  96.857826
12957 2013-08-30 23:40:00  92.624406
12958 2013-08-30 23:50:00  85.402094
12959 2013-08-31 00:00:00  93.870912

This is samples taken every 10 minutes going back several months.  I 
want to find the mean and variance for all the points that happened at 
the same time each day.  In other words, I want to group by date.time().

I can certainly do this by pulling all the data out of the DataFrame and 
working on it as normal Python data.  But, I suspect there's some easy 
way to do this in pandas and I'm just not seeing it.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Not getting my head around pandas Roy Smith <roy@panix.com> - 2013-08-31 21:23 -0400

csiph-web