Re: [Numpy-discussion] weighted mean; weighted standard error of the mean (sem)

2010-09-19 Thread josef . pktd
On Fri, Sep 17, 2010 at 1:19 PM, wrote: > On Fri, Sep 10, 2010 at 3:01 PM,   wrote: >> On Fri, Sep 10, 2010 at 1:58 PM, Christopher Barrington-Leigh >> wrote: >>> Interesting. Thanks Erin, Josef and Keith. >> >> thanks to the stata page at least I figured out that WLS is aweights >> with asumpti

Re: [Numpy-discussion] loadtxt stop

2010-09-19 Thread Zachary Pincus
>> Though, really, it's annoying that numpy.loadtxt needs both the >> readline function *and* the iterator protocol. If it just used >> iterators, you could do: >> >> def truncator(fh, delimiter='END'): >> for line in fh: >>if line.strip() == delimiter: >> break >>yield line >> >> num

[Numpy-discussion] Question about masked arrays

2010-09-19 Thread Gökhan Sever
Hello, Consider these two sets of container arrays --one defined as usual np array the others as ma arrays: all_measured = np.ma.zeros((16, 18)) all_predicted = np.ma.zeros((16, 18)) all_measured2 = np.zeros((16, 18)) all_predicted2 = np.zeros((16, 18)) I do a computation within

Re: [Numpy-discussion] Inverting argsort(a, axis=0) to obtain column-wise ranks

2010-09-19 Thread John Schulman
Argsort twice and you get the rank. a1.argsort(axis=0).argsort(axis=0) That's because argsort is it's own inverse when applied to the ranks. On Tue, Sep 7, 2010 at 1:01 PM, Alexander Michael wrote: > Calculating ranks by inverting the results of an argsort is > straightforward and fast for 1D a

Re: [Numpy-discussion] Inverting argsort(a, axis=0) to obtain column-wise ranks

2010-09-19 Thread John Schulman
D'oh, Zachary already gave that answer. On Sun, Sep 19, 2010 at 10:17 PM, John Schulman wrote: > Argsort twice and you get the rank. > > a1.argsort(axis=0).argsort(axis=0) > > That's because argsort is it's own inverse when applied to the ranks. > > On Tue, Sep 7, 2010 at 1:01 PM, Alexander Micha