), 4.267)
Roelf
From: numpy-discussion-boun...@scipy.org
[mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Georgios Exarchakis
Sent: 09 October 2013 15:22
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] select column based on another column value
I think you need
I think you need this
>>> testdata[testdata[:,0]==today][:,2].mean()
4.267
>>> testdata[testdata[:,0]==yesterday][:,2].mean()
5.634
>>> testdata[testdata[:,0]==twodaysago][:,2].mean()
2.9336
On 10/09/2013 06:46 AM, Roelf Schreurs wrote:
Hi
I have the fol
Hi
I have the following array and want to calculate the average per day.
Import numpy as np
from datetime import date
today = date(today.year, today.month, 9)
yesterday = date(today.year, today.month, 8)
twodaysago = date(today.year, today.month, 7)
testdata = np.array([[today, "r", 3.2],[toda