Not getting my head around pandas

R

Roy Smith

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top