oops, best of 3: 1.58 µs per loop
In [8]: %timeit echo_numpy(x)
The slowest run took 58.81 times longer than the fastest. This could
mean that an intermediate result is being cached.
100 loops, best of 3: 474 ns per loop
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
Sebastian Berg sebastian at sipsolutions.net writes:
On Mo, 2015-03-16 at 15:53 +, Dave Hirschfeld wrote:
I have a number of large arrays for which I want to compute the mean
and
standard deviation over a particular axis - e.g. I want to compute
the
statistics for axis=1
temporary?
For those who like a challenge: is there a faster way to achieve what
I'm after?
Cheers,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
the
original size.
I don't use einsum that much because I've noticed the performance can be
very problem dependant so I've always profiled it to check. Hopefully
this work will make the performance more consistent, allowing it to be
used more generally throughout my code.
Thanks,
Dave
with `np.dot` it will be clearer
how to translate to using `np.einsum`
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Julian Taylor jtaylor.debian at googlemail.com writes:
On 23.10.2014 19:21, Dave Hirschfeld wrote:
Hi,
I accidentally passed a pandas DatetimeIndex to `np.arange` which
caused
it to segfault. It's a pretty dumb thing to do but I don't think it
should cause a segfault!
thanks
stdin, line 1 in module
The exception dialog which pops up contains the following information:
Unhandled exception at 0x0255EB49 (multiarray.pyd) in
python.exe:
0xC005: Access violation reading location 0x0008.
Thanks,
Dave
by looking at the first and last points of the window; if they are
the same values, then the window is incorrect.
If you use signal.get_window(), the default is sym=False:
def get_window(window, Nx, fftbins=True):
# snip
sym = not fftbins
Dave Cook
It seems that the docs website is down?
http://docs.scipy.org/doc/
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
flexible reshape, like:
arr.reshape(12,-1,...)?
thanks a lot in advance,best,
Chao
For the example given the below code works:
In [1]: x = randn(48,5,4,3,2)
In [2]: x.reshape(12,-1,*x.shape[1:]).shape
Out[2]: (12L, 4L, 5L, 4L, 3L, 2L)
HTH,
Dave
Julian Taylor jtaylor.debian at googlemail.com writes:
On 16.05.2014 10:59, Dave Hirschfeld wrote:
Julian Taylor jtaylor.debian at googlemail.com writes:
Yes, I'd heard about the improvements and am very excited to try them out
since indexing is one of the bottlenecks in our
Sebastian Berg sebastian at sipsolutions.net writes:
On Do, 2014-05-15 at 12:31 +, Dave Hirschfeld wrote:
As can be seen from the code below (or in the notebook linked beneath)
fancy
indexing of a structured array is twice as slow as indexing both fields
independently - making
.
This 50% increase still makes it slower than the simpler indexing
variant as these have been greatly improved in 1.9 (thanks to
Sebastian for this :) )
Yes, I'd heard about the improvements and am very excited to try them out
since indexing is one of the bottlenecks in our algorithm.
-Dave
by combining the arrays into a structured
array and only doing one indexing operation. Unfortunately that doubled the
time that it took!
Is there any reason for this? If not, I'm happy to open an enhancement issue
on GitHub - just let me know.
Thanks,
Dave
In [32]: nrows, ncols = 365, 1
In [33
)
...: df.groupby(lambda d: d.date()).mean()
...:
Out[17]:
values
2014-03-31 1.00
2014-04-01 1.041667
2014-04-02 2.041667
2014-04-03 3.00
[4 rows x 1 columns]
Try it in your timezone and see what you get!
-Dave
___
NumPy-Discussion
Jeff Reback jeffreback at gmail.com writes:
Dave,
your example is not a problem with numpy per se, rather that the default
generation is in local timezone (same as what python datetime does).
If you localize to UTC you get the results that you expect.
The problem is that the default
([[ inf, 0.],
[ 0., 1.]])
In [5]: np.linalg.svd(C)
Out[5]:
(array([[ 0., 1.],
[ 1., 0.]]),
array([ nan, nan]),
array([[ 0., 1.],
[ 1., 0.]]))
In [6]: np.__version__
Out[6]: '1.7.1'
Regards,
Dave
___
NumPy-Discussion
and
people who care about the isfinite cost probably would be linking to a fast
lapack anyway.
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
expect float32 to be able to represent
numbers with exponents as small as -127.
Thanks,
Dave Cook
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
-
Thanks for that.
Dave Cook
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
with whatever the consensus is I just thought I'd put
forward the view from a (specific type of) user perspective.
Regards,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
what's happening.
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
coming from Matlab probably doesn't care that it takes a copy but you'd
be hard pressed to convince them there's any benefit of writing
A.conjugate().transpose() over exactly what it looks like in textbooks - A.H
Regards,
Dave
___
NumPy-Discussion
, dtype='M8[D]').dtype
Out[60]: dtype('M8[us]')???
In [61]: np.datetime64(d).astype('M8[D]')
Out[61]: numpy.datetime64('2013-06-12')
Thanks,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy
be good to get the utc-everywhere fix for datetime64 in there if
someone has time to look into it.
Thanks,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
, manually parsing the strings and creating an
array from the list of datetime objects.
Regards,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Nathaniel Smith njs at pobox.com writes:
On Wed, Apr 3, 2013 at 2:26 PM, Dave Hirschfeld
dave.hirschfeld at gmail.com wrote:
This isn't acceptable for my use case (in a multinational company) and I
found
no reasonable way around it other than bypassing the numpy conversion
entirely
shooting themselves in the foot performance-
wise.
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
://github.com/numpy/numpy/issues/380
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
(most recent call last)
ipython-input-20-0c4fc6d780e3 in module()
1 a[0] = b
TypeError: can't convert complex to float
In [21]: a[0:1] = b
In [22]:
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman
Dave Hirschfeld dave.hirschfeld at gmail.com writes:
It seems that reshape doesn't work correctly on an array which has been
resized using the 0-stride trick e.g.
In [73]: x = array([5])
In [74]: y = as_strided(x, shape=(10,), strides=(0,))
In [75]: y
Out[75]: array([5, 5, 5, 5, 5
:
return y.reshape(shape)
Regards,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Thanks Ralf! I'm interested in unattended/silent installations.
My best,
Dave
---
Date: Sat, 21 Apr 2012 10:48:36 +0200
From: Ralf Gommers ralf.gomm...@googlemail.com
Subject: Re: [Numpy-discussion] Command-line options for (Windows
Hi, is there any documentation available on exactly which command line options
are available from NumPy's 'superpack' installers on Windows? E.g.,
http://docs.scipy.org/doc/numpy/user/install.html mentions an /arch flag, but
I'm not seeing anything else called out.
Thanks!
Dave
cumsumtest import *
True
True
In [2]: timeit npcumsum(a)
100 loops, best of 3: 14.7 ms per loop
In [3]: timeit addaccum(a)
100 loops, best of 3: 15.4 ms per loop
In [4]: timeit loopcumsum(a)
100 loops, best of 3: 2.16 ms per loop
Dave Cook
___
NumPy
()
Out[14]: True
Interesting. I should have mentioned that I'm using numpy 1.5.1 on 64-bit
Ubuntu 10.10. This transpose/compute/transpose trick did not work for me.
In [27]: timeit a.T.cumsum(-1).T
10 loops, best of 3: 18.3 ms per loop
Dave Cook
that as a user (not a developer) talk is cheap and I'm happy with
whatever the consensus is. I just thought I'd pipe up since it was only through
this thread that I re-discovered np.lib.recfunctions!
HTH,
Dave
___
NumPy-Discussion mailing list
NumPy
view
them as mostly complementary but I haven't (yet) had much experience with
pandas...
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
, a dtype like
[('date', 'M8[D]'), ('event', 'i8[mod 100]')] could replace the current
'M8[D]//100'.
Sounds like a cleaner API.
As Dave H. summarized, we used a basic keyword to do the same thing in
scikits.timeseries, with the addition of some subfrequencies like A-SEP
to represent a year
side would be useful...
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Robert Kern robert.kern at gmail.com writes:
On Tue, Jun 7, 2011 at 07:34, Dave Hirschfeld dave.hirschfeld at gmail.com
wrote:
I'm not convinced about the events concept - it seems to add complexity
for something which could be accomplished better in other ways. A [Y]//4
dtype
Christopher Barker Chris.Barker at noaa.gov writes:
Dave Hirschfeld wrote:
That would be one way of dealing with irregularly spaced data. I would argue
that the example is somewhat back-to-front though. If something happens
twice a month it's not occuring at a monthly frequency
of days until expiry resulting in a
subtly different answer - not good.
NB: The timeseries Date/DateArray have a day_of_year attribute which is very
useful.
Regards,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
Disclaimer: I'm on windows (Win7 x64)
Following the instructions at:
http://docs.scipy.org/doc/numpy/dev/gitwash/following_latest.html
I got the following (rather unhelpful) error message:
C:\dev\srcgit clone git://github.com/numpy/numpy.git
Cloning into numpy...
github.com[0: 207.97.227.239]:
Jean-Luc Menut jeanluc.menut at free.fr writes:
I have a little question about the speed of numpy vs IDL 7.0.
Here the IDL result:
% Compiled module: $MAIN$.
2.837
The python code:
from numpy import *
from time import time
time1 = time()
for j in range(1):
for
= np.loadtxt('dummy_data.txt')
In [8]: data.shape
Out[8]: (1,)
In [9]: data = data.reshape(100, 100)
In [10]: data.shape
Out[10]: (100, 100)
In [11]: np.allclose(dummy_data, data)
Out[11]: True
HTH,
Dave
___
NumPy-Discussion mailing list
NumPy
'
In [28]: print(%f %g %e %d % (w,x,y,z,))
68.00 64 1.30e+01 57
In [29]: w, x, y, z
Out[29]: (68, 64, 13, 57)
For a file I would use np.savetxt
HTH,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman
is:
a.reshape(a.shape[0], -1).sum(-1)
HTH,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Richard D. Moores rdmoores at gmail.com writes:
The commands should therefore be:
cd c:\SVNRepository\numpy
C:\Python31python setup.py bdist_wininst
Dave, I got:
c:\SVNRepository\numpyC:\Python31python setup.py bdist_wininst
'C:\Python31' is not recognized as an internal
Richard D. Moores rdmoores at gmail.com writes:
On Mon, Jul 19, 2010 at 06:03, Dave dave.hirschfeld at gmail.com wrote:
My bad - typo. The command to build numpy should have been:
C:\Python31\python setup.py bdist_wininst
I tried that. See the attached.
i.e. the full path
()
finally:
interactive(IS_INTERACTIVE)
NB: Sympy provides the latex function to convert the equation objects into
latex as well as other ways to display the objects in the sympy.printing
module. It shouldn't be too hard to do something similar if someone was so
inclined!
HTH,
Dave
that should be quickly installed when you request to join the
meeting. There is no purchase required, the applet is free.
-- Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
understand why reading in this 57mb txt file is taking
up ~2gb's of RAM.
Any advice? Thanks in advance
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
still had the same problem.
On 9/23/09, Christopher Barker chris.bar...@noaa.gov wrote:
Dave Wood wrote:
Well, I suppose they are all considered to be strings here. I haven't
tried to convert the numbers to floats yet.
This could be an issue. For strings, numpy creates an array of strings
for all the emails.
Dave
On 9/23/09, Dave Wood davejw...@gmail.com wrote:
Appologies for the multiple posts, people. My posting to the forum was
pending for a long time, so I deleted it and tried emailing directly. I
didn't think they'd all be sent out.
Gokan, thanks for the reply, I hope you
Charles R Harris charlesr.harris at gmail.com writes:
Is anyone with this problem *not* running ubuntu?Chuck
All I can say is that it (surprisingly?) doesn't appear to affect my windoze
(XP) box.
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]
In [2]:
fails with the message:
error: option --compiler not recognized
Is it still possible to create a .exe installer on Windows and if so what are
the commands we need to make it work?
Thanks in advance for any help/workarounds it would be much appreciated!
Regards,
Dave
compiling with MingW32, by passing -c mingw32 to setup.py.
I tried without a distutils.cfg file and deleted the build directory both times.
In case it helps the bulid log should be available from
http://pastebin.com/m607992ba
Am I doing something wrong?
-Dave
you check that r7280 fixed it for you ?
cheers,
David
Work's for me.
snip
adding 'SCRIPTS\f2py.py'
creating dist
removing 'build\bdist.win32\wininst' (and everything under it)
Thanks for the quick fix!
-Dave
___
NumPy-Discussion mailing list
Dave dave.hirschfeld at gmail.com writes:
Work's for me.
-Dave
Except now when trying to compile the latest scipy I get the following error:
C:\dev\src\scipysvn up
Fetching external item into 'doc\sphinxext'
External at revision 7280.
At revision 5890.
C:\dev\src\scipypython setup.py
David Cournapeau david at ar.media.kyoto-u.ac.jp writes:
Dave wrote:
Dave dave.hirschfeld at gmail.com writes:
Work's for me.
-Dave
Except now when trying to compile the latest scipy I get the following
error:
Was numpy installed from a bdist_wininst
seem to be be related to the NaN handling.
Thanks for the help today!
-Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
. My fortran wrapper, Forthon, automatically
handles the ordering conversion, copying if needed, but I try to avoid
the copying as much as possible. It would be very nice if some of the
ordering issues could be handled under the covers by numpy.
Dave
the complex data as an array with 2 columns to
make this work. Ideas?
Something like?
gen_qpsk = (array([[1,1j]])*np.loadtxt('gen_qpsk.txt')).sum(1)
HTH,
Dave
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
of such
issues and I'm guessing the casting behaviour is a design decision, nevertheless
I thought I'd post to make others aware of such considerations.
HTH,
Dave
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]
Type copyright, credits or license for more information.
IPython
Hello,
I'm pleased to announce that Enthought Tool Suite (ETS) version 3.2.0
has been tagged and released!
Source distributions (.tar.gz) have been uploaded to PyPi, and Windows
binaries will be follow shortly. A full install of ETS can be done using
Setuptools via a command like:
comments, concerns, or bug reports via the EPD Trac
instance at https://svn.enthought.com/epd or via e-mail to
epd-supp...@enthought.com.
-- Dave
About EPD
-
The Enthought Python Distribution (EPD) is a kitchen-sink-included
distribution of the Python™ Programming Language, including
features include
initialization, validation, delegation, notification, and visualization
of typed attributes.
More information is available for all these packages from the Enthought
Tool Suite development home page:
http://code.enthought.com/projects/index.php
-- Dave
My system..
Ubuntu v8.0.4; Gnu gcc v4.0.3;g95 v0.92
Python v2.5.2;Numpy v1.2.1;f2py v2.5972
Hope someone can see what's wrong here?
thanks
Dave Lang
..Here is the F90 code...
! PROGRAM TO DEMONSTRATE PYTHON--F90 AND F90--PYTHON INTERFACE
can ever get it to work).
I will be most grateful for comments on any or all of this.
thanks
Dave Lang
The Fortran Code:
! PROGAM TO DEMONSTRATE GTOSS FORTRAN - PYTHON CONNECTION
SUBROUTINE CBSET( N, call_back )
!f2py intent(in) N
INTEGER N
!f2py intent(callback
and installation
support are available for individual commercial use. An enterprise
subscription with support for particular deployment environments is also
available for commercial purchase.
-- Dave
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http
Hi All,
Using the current trunk, I am getting the following build error:
creating build\temp.win32-2.5\Release\build
creating build\temp.win32-2.5\Release\build\src.win32-2.5
creating build\temp.win32-2.5\Release\build\src.win32-2.5\numpy
creating
for commercial purchase. The beta versions of EPD are
available for indefinite free trial.
-- Dave
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
documentation hasn't been updated to the current
versions of the third-party libraries.
* Some of the product branding is not up-to-date with regard to the
product name change to EPD with Py2.5, nor with the version number of
4.0.30001 Beta 1.
-- Dave
___
Numpy
a simple ets up (or svn up)
should bring you up to date. Others may wish to grab a complete new
checkout via a ets co ETS. The release branches that had been created
are now removed. The next release is currently expected to be ETS 3.0.1
-- Dave
Enthought Tool Suite
I'm pleased to announce that Enthought has released the Enthought Python
Distribution (EPD) 2.5.2001 for OS X!
EPD is a Distribution of the Python Programming Language (currently
version 2.5.2) that includes over 60 additional libraries, including ETS
2.7.1. Please visit the EPD website
are automatically inherited by any subclass derived from the class.
-- Dave
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
This may be of interest,
LLVM support in Mesa, and i believe there is work doing on with LLVM
and python in the pypy camp.
http://zrusin.blogspot.com/2007/05/mesa-and-llvm.html
I just stumbled on this page, while this conversation was happening :)
Dave
On 6/2/07, Bob Lewis [EMAIL PROTECTED
-packages/numpy/linalg/linalg.py, line
575, in svd
vt = zeros((n, nvt), t)
MemoryError
Cheers
Dave
On 5/13/07, Anne Archibald [EMAIL PROTECTED] wrote:
On 12/05/07, Dave P. Novakovic [EMAIL PROTECTED] wrote:
core 2 duo with 4gb RAM.
I've heard about iterative svd functions. I actually
Are you trying some sort of principal components analysis?
PCA is indeed one part of the research I'm doing.
Dave
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
to build a
space around it.)
Cheers
Dave
On 5/14/07, Charles R Harris [EMAIL PROTECTED] wrote:
On 5/13/07, Dave P. Novakovic [EMAIL PROTECTED] wrote:
Are you trying some sort of principal components analysis?
PCA is indeed one part of the research I'm doing.
I had the impression you
, or too many dims), I'm starting to feel like I'm in a bit of
trouble here :)
What do people use to do large svd's? I'm not adverse to using another
lib or wrapping something.
Cheers
Dave
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http
84 matches
Mail list logo