:
out_dict = {}
out = np.zeros_like(a)
count = 0
stack = np.vstack((a, b, c)).T
for (i, arr) in enumerate(stack):
t = tuple(arr)
if t not in out_dict:
out_dict[t] = count
count += 1
out[i] = out_dict[t]
Thanks for help,
matt
_
ts. This info got me a
more useful error message, which I used to make this commit to my local
fork:
https://github.com/mttp/numpy/commit/480c51b17c608a2cbcca65b8a633dbe1b1654070
Seems to fix the problem.
--
Matt Pagan
m...@pagan.io
PGP: 0xE9284418E360583C
___
t see functions like this associated with any of the
other classes in numpy/lib/tests/test_twodim_base.py though.
Any hints on how to proceed?
--
Matt Pagan
m...@pagan.io
PGP: 0xE9284418E360583C
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.
of
my patch? Should I make a github pull request?
- --
Matt Pagan
m...@pagan.io
PGP: 0xE9284418E360583C
-BEGIN PGP SIGNATURE-
iQIcBAEBCgAGBQJTMGKDAAoJEOkoRBjjYFg8DXwQALE95t9SS8xsFD0PpO3SwZNQ
v2SxcnzH123mcrq55zzzHGgh9OUz694fqky2thyiazhKf5sSVka1Gf4b6U06nXE7
OG7+i9qGZgAf6cLBItmPYp2F
if j==None and t==None:
+raise ValueError("One or more of %s and %s must be set." % \
+('j', 't'))
+return None
+elif t==None:
+swap = np.array(m[i])
+m[i] = m[j]
+m[j] = swap
+return m
+ elif j==None:
+
is no
bug to report.
I only assumed that the header files weren't installed because I couldn't find
them in the include dir inside the python installation, and the installer gave
no options. I'm not well versed in the normal system for compiling and
dist
few modifications to _numpyconfig.h got my extension compiled and working.
Is there any chance that the includes could be included in future releases?
Thanks,
Matt Newell
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/ma
Hey NumPy users,
My name is Matt, and I'm part of Plot.ly, a graphing and analytics startup.
We just launched a beta, and wanted to reach out to this group about our
Python and Numpy features.
*Background.* Plotly's graphing libraries let you make interactive,
publication-quality plo
nfig.add_extension(
sources=sources,
extra_info=extra_info,
extra_link_args=extra_link_args
)
setup(**config.todict())
Thanks!
-matt
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
> HTH,
> -Chris
>
Hi Chris,
Thanks for the reply, you've just saved me a lot of time. I did run across
'views' but it looked like I couldn't have my data arbitrarily arranged. Thank
you for confirming that. Unfortunately my
Is it possible to create a numpy array which points to the same data in a
different numpy array (but in different order etc)?
For example:
Code:
--
import numpy as np
a = np.arange(10)
ids = np.array([0,0,5,5,9,9,1,1])
b
> Nice, I am starting to get out of touch with too many packages...
> Would be nice to add DCT and DST support to it.
FWIW, the DCT has been in scipy.fftpack for a while and DST was just added.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
More reading of the thread linked solved the issue. To reiterate, add
numpy/ and change .c to .h in line 590 of ieee754.c.src.
Ex:
elif defined(__CYGWIN__)
include "numpy/fenv/fenv.h"
endif
Thanks,
On Wed, Feb 29, 2012 at 1:41 PM, Matt Miller wrote:
> That fixed changed my
That fixed changed my error message to this:
numpy/core/src/private/lowlevel_strided_loops.h:404:1: warning:
‘PyArray_PrepareThreeRawArrayIter’ declared ‘static’ but never defined
numpy/core/src/private/lowlevel_strided_loops.h:430:1: warning:
‘PyArray_PrepareFourRawArrayIter’ declared ‘static’ bu
Hi all,
I am getting the following error when running `python setup.py install` for
Numpy in Cygwin. This error happens on the latest as well as
the maintenance branched for 1.5 and 1.6.
...
creating build/temp.cygwin-1.7.11-i686-2.6
creating build/temp.cygwin-1.7.11-i686-2.6/build
creating build
sively with relational databases (sql server, mysql, etc) and
all (most?) of the python database adapters use python datetime objects
when passing data back and forth from the database to python. So people wanting
to analyze date / time series data from relational databases in n
that I was after:
http://sites.google.com/site/spatialpython/zonal-statistics
thanks, matt
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
er!
So I would need to get the dtype object...
myData[ myData.dtype.names[0] ]
in order to index by column.
Matt
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Hi all
first, please forgive me for my ignorance - I am taking my first
stumbling steps with numpy and scipy.
I am having some difficulty with the behaviour of genfromtxt.
s = SIO.StringIO("""1, 2, 3
4, 5, 6
7, 8, 9""")
g= genfromtxt(s, delimiter=', ', dtype=None)
print g[:,0]
This produces th
ython for this purpose.
>
> Nadav
>
> -Original Message-
> From: numpy-discussion-boun...@scipy.org on behalf of Matt Fearon
> Sent: Mon 24-May-10 15:43
> To: Discussion of Numerical Python
> Subject: Re: [Numpy-discussion] calling C function from Python via f2py
>
,Fo)
Should this execute the C code?
thanks,
Matt
On Sun, May 23, 2010 at 1:44 AM, Nadav Horesh wrote:
>
> in test.py change to
>
> print FFMCcalc.FFMCcalc(T,H,W,ro,Fo)
>
> As implied from the line
>
> print FFMCcalc.FFMCcalc.__doc__
>
> Nadav
>
>
tax
is:
f2py -c -lm FFMCcalc.pyf FFMCcalc.c
Also, my 3 scripts are short and attached.
1. FFMCcalc.c, C function
2. FFMCcalc.pyf, wrapper file
3. test.py, short python code that calls C function
Any advice would greatly appreciated to get this working.
thanks,
Matt
double FFMCcalc(double T
at the TimeSeries class in the scikits.timeseries
module for a rather extensive example of subclassing MaskedArray
- Matt
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
some ideas. All the code that deals with masked arrays
is located here:
http://svn.scipy.org/svn/scikits/trunk/timeseries/scikits/timeseries/src/c_tseries
.c
The functions that deal with frequency conversion and calculating moving sums,
averages, etc all dea
cel probably seems about right. Although maybe it is more appropriate for
scipy than numpy.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
ionality (which is
probably an impossible task realistically).
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
ile this doesn't affect me personally... I wonder if everyone is aware of
this. Importing modules generally shouldn't have side effects either I would
think. Has this always been the case for the masked array module?
- Matt
___
Numpy-discussi
np.seterr(divide='ignore',invalid='ignore') before calling the ufunc
This isn't a thread safe approach and could cause wierd side effects in a
multi-threaded application. I think modifying global options/variables inside
any function where it generally would
>> >> If it's really just weekdays why not call it that instead of using a
>> >> term like business days that (quite confusingly) suggests holidays
>> >> are handled properly?
>>
>> Well, we were adopting the name from the TimeSeries package. Perhaps
>> the authors can answer this better than me.
7;ll be
able to help much on the initial implementation, but once you have a framework
in place I may be able to pitch in with some of the details. Please keep us
posted.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
re and it works amazingly well, then I'd probably get on
board. I just think that may be difficult to do with a general purpose date
dtype suitable for inclusion in the numpy core.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy
using the built in parser in the timeseries module (borrowed from
mx.DateTime). Observe...
>>> dlist = ['14-jan-2001 14:34:33', '16-jan-2001 10:09:11']
>>> a = ts.date_array(dlist, freq='secondly')
>>> a
DateArray([14-Jan-2001
em in with your .rst files
similar to
how the autodoc sphinx extension works (rather than just pre-generating a
big
dump of all the doc strings into a single .rst file). This is probably a
question more for the sphinx mailing list, but I thought I'd ask while I'm
on
the topic in case
ats has long
since been deleted from svn. Try wiping out your numpy installation and starting
from scratch.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
numbers).
If you need more detail, let me know and I can make a fuller example.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
> installed fine and all tests ran successfully on my machine.
I spoke too soon. I didn't know about the "all" parameter in numpy.test and
just ran if with the default before. When I specify all=True, I get 12 errors.
Most of which seem to be related to a problem with calling the "tolist"
method.
David Cournapeau ar.media.kyoto-u.ac.jp> writes:
>
> Hi,
>
> Sorry for the delay, but it is now ready: numpy "superpack"
> installers for numpy 1.1.0rc1:
>
>
http://www.ar.media.kyoto-u.ac.jp/members/david/archives/numpy-1.1.0rc1-win32-superpack-python2.5.exe
>
http://www.ar.media.kyoto-u
On Sun, May 18, 2008 at 9:14 PM, Anne Archibald
<[EMAIL PROTECTED]> wrote:
> 2008/5/18 Matt Crane <[EMAIL PROTECTED]>:
>> On Sun, May 18, 2008 at 8:52 PM, Robert Kern <[EMAIL PROTECTED]> wrote:
>>> Are there repeats?
>> No, no repeats in the first column.
to leave out any
potentially vital information again. It's going to be a long day.
Thanks,
Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
he first column are monotonically increasing (again something I
should have mentioned -- I blame a lack of caffeine) - could we make
it faster?
Thanks, for everything up to this point though.
Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http:/
On Sun, May 18, 2008 at 7:19 PM, Robert Kern <[EMAIL PROTECTED]> wrote:
> Are the matching rows always going to be the same row in each? I.e.
> you want rows i such that a[i,0]==b[i,0] rather than trying to find
> all i,j such that a[i,0]==b[j,0]?
>
> If so, then I would do the following:
>
>
> In
aind += 1
elif a[aind, 0] > b[bind, 0]:
bind += 1
else:
results.append([a[aind, 1], b[bind, 1]])
aind += 1
bind += 1
results = array(results)
Where aind = bind = 0, amax = a.shape[0] and bmax = b.shape
(as far as I know) by design, and makes
sense to me at least. If you disagree with some of the above behaviour, then I'm
sure people would be happy to hear your opinion, but it is incorrect to flatly
call this a bug.
- Matt
___
Numpy-discussion ma
in the data portion of the masked array, but the old version
perhaps doesn't based on the output you are showing.
>
> 2. why is the wrong fill value being used here?
the second element in the array iteration here is actually the numpy.ma.masked
constant, which always has the same fill valu
I noticed that the new masked array module resides in numpy/ma in the
maskedarray branch as opposed to numpy/core/ma like it does in the current
trunk. Was this intentional? Code that explicitly imports ma from the core
subfolder will break from this change (like the __init__.py script for the
eries package in the scipy SVN ? We (Matt Knox
> and I) tried to address some of these issues for environmental and financial
> time series.
> http://www.scipy.org/SciPyPackages/TimeSeries
>
I have just added a trailing max and trailing min function to the timeseries
package to g
mpy.ma anyway, but I suspect some people might have a problem with that. So
what is the best way to do this?
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
quick
to implement fixes for. The fact that it works seamlessly as a drop in
replacement in matplotlib is a good sign as far as backwards compatibility.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
er, as
well as "pretty printing" (and plotting). There is also a sub-module in the
package for record array TimeSeries objects of sorts... but Pierre would be more
qualified to talk about that than me.
We LOVE getting new testers and feedback, so if you'
Heading == instead of Heading ). And
perhaps for applications where it isn't entirely obvious what it does based on
the name, a brief (less than one line) description in brackets beside the
heading? (eg. "Inkscape (vector graphics editor)")
I'm not a professional wiki
perts on this list would be able to
shed some light on a good way to create thread safe subclasses of ndarray.
Thanks,
- Matt Knox___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
ing about these kinds of issues in the future.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
peed critical parts in C would still be a
nice improvement.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
ut the example script isn't fully
updated to reflect the latest code either.
If you do play around with it though, I would love to hear your thoughts on it
and any criticisms/suggestions you may have.
- Matt
___
Numpy-discussion mailin
> This makes sense to me. I'm generally favorable to the new maskedarray
> (I actually like the idea of it being a sub-class). I'm just waiting
> for people that actually use the MaskedArray to comment.
>
> For 1.1 I would really like to move most of the often-used sub-classes
> of the ndarr
s the brute force way of doing it. And I think the code looks a
little nicer too which is always nice. Definitely a technique I will be using
in the future.
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
assed to it, that would be super slick... but
that is probably a few leaps beyond my current knowledge level to code that.
Thanks again everybody,
- Matt
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
> On Friday 05 of January 2007 17:42, Matt Knox wrote:
> > -
> > Example 1 - exponential moving average:
> >
> > # naive brute force method...
> > def expmave(x, k):
> > result = numpy.array(x, copy=T
---
Is their a good way to do these kinds of things without python looping? Or is
that going to require writing a ufunc in C? Any help is greatly appreciated.
Thanks,
- Matt Knox
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://p
all I can come up with is dumb brute force methods by iterating through all the
values. Anyone got any tricks I can use?
Thanks,
- Matt Knox
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo
60 matches
Mail list logo