Re: [Numpy-discussion] Building Windows binaries on OS X

2010-02-09 Thread Ralf Gommers
On Tue, Feb 9, 2010 at 9:54 AM, David Cournapeau courn...@gmail.com wrote:

 On Mon, Feb 8, 2010 at 9:14 PM, Ralf Gommers
 ralf.gomm...@googlemail.com wrote:
  Hi David and all,
 
  I have a few questions on setting up the build environment on OS X for
  Windows binaries. I have Wine installed with Python 2.5 and 2.6, MakeNsis
  and MinGW. The first question is what is meant in the Paver script by
 cpuid
  plugin. Wine seems to know what to do with a cpuid instruction, but I
 can
  not find a plugin. Searching for cpuid plugin turns up nothing except
 the
  NumPy pavement.py file. What is this?

 That's a small NSIS plugin to detect at install time the exact
 capabilities of the CPU (SSE2, SSE3, etc...). The sources are found in
 tools/win32build/cpucaps, and should be built with mingw (Visual
 Studio is not supported, it uses gcc-specific inline assembly). You
 then copy the dll into the plugin directory of nsis.


Yep got it. There's quite some stuff hidden in tools/ and vendor/ that I
never noticed before.



  Final question is about Atlas and friends. Is 3.8.3 the best version to
  install? Does it compile out of the box under Wine? Is this page
  http://www.scipy.org/Installing_SciPy/Windows still up-to-date with
 regard
  to the Lapack/Atlas info and does it apply for Wine?

 Atlas 3.9.x should not be used, it is too unstable IMO (it is a dev
 version after all, and windows receives little testing compared to
 unix). I will put the Atlas binaries I am using somewhere


That would be *great*.

Thanks,
Ralf
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Vishal Rana
Hi,

Is there any utility function to find if values in the array are in
ascending or descending order.

Example:
arr = [1, 2, 4, 6] should return true
arr2 = [1, 0, 2, -2] should return false

Thanks
Vishal
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Keith Goodman
On Tue, Feb 9, 2010 at 7:42 AM, Vishal Rana ranavis...@gmail.com wrote:
 Hi,
 Is there any utility function to find if values in the array are in
 ascending or descending order.
 Example:
 arr = [1, 2, 4, 6] should return true
 arr2 = [1, 0, 2, -2] should return false
 Thanks
 Vishal

I don't know if it is fast but np.diff should do the trick. You can
check if all values are less than or equal to zero. Or if all are
greater.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Brent Pedersen
On Tue, Feb 9, 2010 at 7:42 AM, Vishal Rana ranavis...@gmail.com wrote:
 Hi,
 Is there any utility function to find if values in the array are in
 ascending or descending order.
 Example:
 arr = [1, 2, 4, 6] should return true
 arr2 = [1, 0, 2, -2] should return false
 Thanks
 Vishal

 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion



i dont know if there's a utility function, but i'd use:

  np.all(a[1:] = a[:-1])
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Keith Goodman
On Tue, Feb 9, 2010 at 7:51 AM, Brent Pedersen bpede...@gmail.com wrote:
 On Tue, Feb 9, 2010 at 7:42 AM, Vishal Rana ranavis...@gmail.com wrote:
 Hi,
 Is there any utility function to find if values in the array are in
 ascending or descending order.
 Example:
 arr = [1, 2, 4, 6] should return true
 arr2 = [1, 0, 2, -2] should return false
 Thanks
 Vishal

 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion



 i dont know if there's a utility function, but i'd use:

   np.all(a[1:] = a[:-1])

Yes, that's much better than np.diff.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Vishal Rana
Thanks
On Tue, Feb 9, 2010 at 7:51 AM, Brent Pedersen bpede...@gmail.com wrote:

 On Tue, Feb 9, 2010 at 7:42 AM, Vishal Rana ranavis...@gmail.com wrote:
  Hi,
  Is there any utility function to find if values in the array are in
  ascending or descending order.
  Example:
  arr = [1, 2, 4, 6] should return true
  arr2 = [1, 0, 2, -2] should return false
  Thanks
  Vishal
 
  ___
  NumPy-Discussion mailing list
  NumPy-Discussion@scipy.org
  http://mail.scipy.org/mailman/listinfo/numpy-discussion
 
 

 i dont know if there's a utility function, but i'd use:

   np.all(a[1:] = a[:-1])
 ___
 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/mailman/listinfo/numpy-discussion


[Numpy-discussion] Emulate left outer join?

2010-02-09 Thread David Carmean

Hi,

I've been working with numpy for less than a month, having learned about 
it after finding matplotlib.  My foundation in things like set theory is...
weak to nonexistent, so I need a little help mapping sql-like thoughts into 
set-theory thinking :)


Some context to help me explain:  I'm trying to store, chart, and analyze 
unix system performance data (sar/sadf output).  On a typical system I have 
about 75 fields/variables, all floats, with identical timestamps... or so 
we hope.   What I want to do in order to save memory/disk space is to stack 
the timeseries data all into three or four different arrays, and use a single 
timestamp field for each set.

My problem is: I don't know that I can guarantee that the shape of all the 
individual arrays will be identical along the time axis.  I may receive 
truncated textfiles to parse, or new variables may appear and disappear from 
the set being reported/recorded.

If these were in flat files or database tables, I'd do a left outer join 
between 
a master timestamp table and each individual variable's table.   But... I don't 
know the keywords to search for in the numpy docs/web chatter.  A thread from 
just about one year ago left the question hanging:

http://article.gmane.org/gmane.comp.python.numeric.general/27942

Examples? Pointers?  Shoves toward the correct sections of the docs?

Thanks.




___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Robert Kern
On Tue, Feb 9, 2010 at 15:52, David Carmean d...@halibut.com wrote:

 Hi,

 I've been working with numpy for less than a month, having learned about
 it after finding matplotlib.  My foundation in things like set theory is...
 weak to nonexistent, so I need a little help mapping sql-like thoughts into
 set-theory thinking :)


 Some context to help me explain:  I'm trying to store, chart, and analyze
 unix system performance data (sar/sadf output).  On a typical system I have
 about 75 fields/variables, all floats, with identical timestamps... or so
 we hope.   What I want to do in order to save memory/disk space is to stack
 the timeseries data all into three or four different arrays, and use a single
 timestamp field for each set.

 My problem is: I don't know that I can guarantee that the shape of all the
 individual arrays will be identical along the time axis.  I may receive
 truncated textfiles to parse, or new variables may appear and disappear from
 the set being reported/recorded.

 If these were in flat files or database tables, I'd do a left outer join 
 between
 a master timestamp table and each individual variable's table.   But... I 
 don't
 know the keywords to search for in the numpy docs/web chatter.  A thread from
 just about one year ago left the question hanging:

    http://article.gmane.org/gmane.comp.python.numeric.general/27942

 Examples? Pointers?  Shoves toward the correct sections of the docs?

numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter')

In [23]: numpy.lib.recfunctions.join_by?
Type: function
Base Class:   type 'function'
Namespace:Interactive
File: /Users/rkern/svn/numpy/numpy/lib/recfunctions.py
Definition:   numpy.lib.recfunctions.join_by(key, r1, r2,
jointype='inner', r1postfix='1', r2postfix='2', defaults=None,
usemask=True, asrecarray=False)
Docstring:
Join arrays `r1` and `r2` on key `key`.

The key should be either a string or a sequence of string corresponding
to the fields used to join the array.
An exception is raised if the `key` field cannot be found in the two input
arrays.
Neither `r1` nor `r2` should have any duplicates along `key`: the presence
of duplicates will make the output quite unreliable. Note that duplicates
are not looked for by the algorithm.

Parameters
--
key : {string, sequence}
A string or a sequence of strings corresponding to the fields used
for comparison.
r1, r2 : arrays
Structured arrays.
jointype : {'inner', 'outer', 'leftouter'}, optional
If 'inner', returns the elements common to both r1 and r2.
If 'outer', returns the common elements as well as the elements of r1
not in r2 and the elements of not in r2.
If 'leftouter', returns the common elements and the elements of r1 not
in r2.
r1postfix : string, optional
String appended to the names of the fields of r1 that are present in r2
but absent of the key.
r2postfix : string, optional
String appended to the names of the fields of r2 that are present in r1
but absent of the key.
defaults : {dictionary}, optional
Dictionary mapping field names to the corresponding default values.
usemask : {True, False}, optional
Whether to return a MaskedArray (or MaskedRecords is `asrecarray==True`)
or a ndarray.
asrecarray : {False, True}, optional
Whether to return a recarray (or MaskedRecords if `usemask==True`) or
just a flexible-type ndarray.

Notes
-
* The output is sorted along the key.
* A temporary array is formed by dropping the fields not in the key for the
  two arrays and concatenating the result. This array is then sorted, and
  the common entries selected. The output is constructed by
filling the fields
  with the selected entries. Matching is not preserved if there are some
  duplicates...


For some reason, numpy.lib.recfunctions isn't in the documentation
editor. I'm not sure why.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
  -- Umberto Eco
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Fernando Perez
On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern robert.k...@gmail.com wrote:

 numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter')


And if that isn't sufficient, John has in matplotlib.mlab a few other
similar utilities that allow for more complex cases:

In [2]: mlab.rec_
mlab.rec_append_fields  mlab.rec_groupbymlab.rec_keep_fields
mlab.rec_drop_fieldsmlab.rec_join   mlab.rec_summarize

Cheers,

f
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread John Hunter
On Tue, Feb 9, 2010 at 4:43 PM, Fernando Perez fperez@gmail.com wrote:
 On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern robert.k...@gmail.com wrote:

 numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter')


 And if that isn't sufficient, John has in matplotlib.mlab a few other
 similar utilities that allow for more complex cases:

The numpy.lib.recfunctions were ported from matplotlib.mlab so most of
the functionality is overlapping, but we have added some stuff since
the port, eg matplotlib.mlab.recs_join for a multiway join, and some
stuff was never ported (rec_summarize, rec_groupby) so it may be worth
looking in mlab too.  Some of the stuff for mpl is only in svn but
most of it is released.

Examples are at

  http://matplotlib.sourceforge.net/examples/misc/rec_join_demo.html
  http://matplotlib.sourceforge.net/examples/misc/rec_groupby_demo.html

JDH
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread David Warde-Farley
On 9-Feb-10, at 5:02 PM, Robert Kern wrote:

 Examples? Pointers?  Shoves toward the correct sections of the docs?

 numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter')

Huh. All these years, how have I missed this?

Yet another demonstration of why my never skip over a Kern posting  
policy exists.

David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Robert Kern
On Tue, Feb 9, 2010 at 17:47, Ralf Gommers ralf.gomm...@googlemail.com wrote:


 On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern robert.k...@gmail.com wrote:


 For some reason, numpy.lib.recfunctions isn't in the documentation
 editor. I'm not sure why.

 Because it's not in np.lib.__all__ .

Then there needs to be a secondary way to add such modules.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
  -- Umberto Eco
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread josef . pktd
On Tue, Feb 9, 2010 at 6:52 PM, Robert Kern robert.k...@gmail.com wrote:
 On Tue, Feb 9, 2010 at 17:47, Ralf Gommers ralf.gomm...@googlemail.com 
 wrote:


 On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern robert.k...@gmail.com wrote:


 For some reason, numpy.lib.recfunctions isn't in the documentation
 editor. I'm not sure why.

 Because it's not in np.lib.__all__ .

 Then there needs to be a secondary way to add such modules.

Under which namespace should the recfunctions be accessed.

I think, it's possible to directly import/reference them in the docs
without adding them to lib.__all__

Josef

 --
 Robert Kern

 I have come to believe that the whole world is an enigma, a harmless
 enigma that is made terrible by our own mad attempt to interpret it as
 though it had an underlying truth.
  -- Umberto Eco
 ___
 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/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Robert Kern
On Tue, Feb 9, 2010 at 18:02,  josef.p...@gmail.com wrote:
 On Tue, Feb 9, 2010 at 6:52 PM, Robert Kern robert.k...@gmail.com wrote:
 On Tue, Feb 9, 2010 at 17:47, Ralf Gommers ralf.gomm...@googlemail.com 
 wrote:


 On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern robert.k...@gmail.com wrote:


 For some reason, numpy.lib.recfunctions isn't in the documentation
 editor. I'm not sure why.

 Because it's not in np.lib.__all__ .

 Then there needs to be a secondary way to add such modules.

 Under which namespace should the recfunctions be accessed.

numpy.lib.recfunctions

 I think, it's possible to directly import/reference them in the docs
 without adding them to lib.__all__

Okay. What is that way? What do we need to do to make that happen?

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth.
  -- Umberto Eco
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Pierre GM
On Feb 9, 2010, at 6:52 PM, Robert Kern wrote:
 On Tue, Feb 9, 2010 at 17:47, Ralf Gommers ralf.gomm...@googlemail.com 
 wrote:
 
 
 On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern robert.k...@gmail.com wrote:
 
 
 For some reason, numpy.lib.recfunctions isn't in the documentation
 editor. I'm not sure why.
 
 Because it's not in np.lib.__all__ .
 
 Then there needs to be a secondary way to add such modules.

All,
I started porting JDH's functions from mlab to numpy.lib because I thought it'd 
be nice to have them directly in the core of numpy, instead of spread out in 
another package. However, I wanted to get a lot of feedback before advertising 
them:
* Should we put matplotlib.mlab functions directly into numpy ? I do think so, 
even if I think we should make them a tad more generic and not tie them to 
recarrays (you can do the same thing with structured arrays without the 
overhead, albeit without the convenience of access-as-attributes).
* If yes to the question above, how should we proceed ? John, you mind 
committing these functions to numpy.lib.rec_functions yourself ? If you can't, 
any volunteer (I can do it but it would fall low on my priority list).
Once this is settle, then we could think about a way to present them in the 
reference and/or user manual (like I did for genfromtxt).
Let me know what y'all think.
P.


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] numpy.polynomial.chebyshev (not) in the docs

2010-02-09 Thread josef . pktd
Similar to the recfunctions, I also don't find the new chebychev
polynomials in the docs.

Are they linked from any rst file?

A search in the online sphinx html docs comes up empty, and
http://docs.scipy.org/numpy/docs/numpy-docs/reference/routines.poly.rst/#routines-poly
doesn't link to the new functions.

The docstrings look nice but maybe nobody sees them.

Josef
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Pauli Virtanen
ti, 2010-02-09 kello 18:04 -0600, Robert Kern kirjoitti:
 On Tue, Feb 9, 2010 at 18:02,  josef.p...@gmail.com wrote:
[clip]
 numpy.lib.recfunctions

  I think, it's possible to directly import/reference them in the docs
  without adding them to lib.__all__
 
 Okay. What is that way? What do we need to do to make that happen?

To get them in the web app, I need to adjust the web app configuration
on new.scipy.org. I didn't know about that those functions, so I missed
them earlier.

Getting them to the docs goes as Josef explained, just add a rst file
and refer to it in the others.

***

But, should we make these functions available under some less
internal-ish namespace? There's numpy.rec at the least -- it could be
made a real module to pull in things from core and lib.

-- 
Pauli Virtanen

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Pierre GM
On Feb 9, 2010, at 7:54 PM, Pauli Virtanen wrote:
 
 But, should we make these functions available under some less
 internal-ish namespace? There's numpy.rec at the least -- it could be
 made a real module to pull in things from core and lib.

I still think these functions are more generic than the rec_ prefix let think, 
and I'd still prefer a decision being made about what should go in the module 
before thinking too hard about how to advertise it.


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread josef . pktd
On Tue, Feb 9, 2010 at 7:06 PM, Pierre GM pgmdevl...@gmail.com wrote:
 On Feb 9, 2010, at 6:52 PM, Robert Kern wrote:
 On Tue, Feb 9, 2010 at 17:47, Ralf Gommers ralf.gomm...@googlemail.com 
 wrote:


 On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern robert.k...@gmail.com wrote:


 For some reason, numpy.lib.recfunctions isn't in the documentation
 editor. I'm not sure why.

 Because it's not in np.lib.__all__ .

 Then there needs to be a secondary way to add such modules.

 All,
 I started porting JDH's functions from mlab to numpy.lib because I thought 
 it'd be nice to have them directly in the core of numpy, instead of spread 
 out in another package. However, I wanted to get a lot of feedback before 
 advertising them:

chicken and egg problem, without advertising very few users know they exist

 * Should we put matplotlib.mlab functions directly into numpy ? I do think 
 so, even if I think we should make them a tad more generic and not tie them 
 to recarrays (you can do the same thing with structured arrays without the 
 overhead, albeit without the convenience of access-as-attributes).
 * If yes to the question above, how should we proceed ? John, you mind 
 committing these functions to numpy.lib.rec_functions yourself ? If you 
 can't, any volunteer (I can do it but it would fall low on my priority list).
 Once this is settle, then we could think about a way to present them in the 
 reference and/or user manual (like I did for genfromtxt).
 Let me know what y'all think.
 P.

I think it's very helpful to have more helper functions and
documentation to work with structured arrays. I also think that for
newcomers the distinction in the documentation between recarrays and
arrays with structured dtypes is not very clear, and how to work with
structured arrays is not sufficiently documented.

Essentially I only learned about them because of an answer Pierre gave
once to me on the mailing list and I started to read the matplotlib
and numpy source to see how to work with them. It also seems that
structured arrays become the more recommended approach than recarrays
(e.g. discussion by tabular developers on the mailing list and their
switch to structured arrays).

So, I'm in favor of advertising them, and advertising them for
structured arrays and only secondary for recarrays.

I have no idea about a good name that would suggest structured instead of rec.

Josef




 ___
 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/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread John Hunter
On Tue, Feb 9, 2010 at 7:02 PM, Pierre GM pgmdevl...@gmail.com wrote:
 On Feb 9, 2010, at 7:54 PM, Pauli Virtanen wrote:

 But, should we make these functions available under some less
 internal-ish namespace? There's numpy.rec at the least -- it could be
 made a real module to pull in things from core and lib.

 I still think these functions are more generic than the rec_ prefix let 
 think, and I'd still prefer a decision being made about what should go in the 
 module before thinking too hard about how to advertise it.

I would love to see many of these as methods of record/structured
arrays, so we could say

  r = r1.join('date', r2)

or

  rs = r.groupby( ('year', 'month'), stats)

and have totxt, tocsv. etc... from rec2txt, rec2csv, etc...   I
think the functionality of mlab.rec_summarize and rec_groupby is very
useful, but the interface is a bit clunky and could be made easier for
the common use cases.

These methods could call the proper functions from np.lib.recfunctions
or wherever, and they would get a lot more visibility to people using
introspection.

JDH
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread Pierre GM
On Feb 9, 2010, at 8:16 PM, John Hunter wrote:
 I still think these functions are more generic than the rec_ prefix let 
 think, and I'd still prefer a decision being made about what should go in 
 the module before thinking too hard about how to advertise it.
 
 I would love to see many of these as methods of record/structured
 arrays, so we could say

Won't work w/ structured arrays, but completely doable for recarrays.
Let's define the functions so that they take a structured array as first 
argument when possible, and add the functions as a methods to np.recarray. That 
should be fairly transparent, provided we stick to access-as-key instead of 
access-as-attribute

 and have totxt, tocsv. etc... from rec2txt, rec2csv, etc...   I
 think the functionality of mlab.rec_summarize and rec_groupby is very
 useful, but the interface is a bit clunky and could be made easier for
 the common use cases.

Are you going to work on it or should I step in (in a few weeks...).

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.polynomial.chebyshev (not) in the docs

2010-02-09 Thread David Goldsmith
Are you talking about absence in the Wiki or absence in a NumPy executable.
They're in the former (I've been editing them), and they're in 1.4.0 of the
latter:

 import numpy as N
 N.version.version
'1.4.0'
 from numpy.polynomial import chebyshev as C
 help(C.chebfit)
Help on function chebfit in module numpy.polynomial.chebyshev:

chebfit(x, y, deg, rcond=None, full=False)
Least squares fit of Chebyshev series to data.

Fit a Chebyshev series ``p(x) = p[0] * T_{deq}(x) + ... + p[deg] *
T_{0}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of
coefficients `p` that minimises the squared error.

Parameters
--
x : array_like, shape (M,)
x-coordinates of the M sample points ``(x[i], y[i])``.
y : array_like, shape (M,) or (M, K)
y-coordinates of the sample points. Several data sets of sample
points sharing the same x-coordinates can be fitted at once by
passing in a 2D-array that contains one dataset per column.
Etc.

 What version of NumPy are you running?

DG

On Tue, Feb 9, 2010 at 4:40 PM, josef.p...@gmail.com wrote:

 Similar to the recfunctions, I also don't find the new chebychev
 polynomials in the docs.

 Are they linked from any rst file?

 A search in the online sphinx html docs comes up empty, and

 http://docs.scipy.org/numpy/docs/numpy-docs/reference/routines.poly.rst/#routines-poly
 doesn't link to the new functions.

 The docstrings look nice but maybe nobody sees them.

 Josef
 ___
 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/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.polynomial.chebyshev (not) in the docs

2010-02-09 Thread josef . pktd
On Tue, Feb 9, 2010 at 9:30 PM, David Goldsmith d.l.goldsm...@gmail.com wrote:
 Are you talking about absence in the Wiki or absence in a NumPy executable.
 They're in the former (I've been editing them), and they're in 1.4.0 of the
 latter:

I have them in numpy 1.4, I see them in the doceditor, but not in
http://docs.scipy.org/doc/numpy/search.html?q=chebychevcheck_keywords=yesarea=default

or search for chebfit

I think they are not added to the html docs because they are not
referenced in any rst file.
That's a different issue from having them in the source and the
doceditor application.


Josef


 import numpy as N
 N.version.version
 '1.4.0'
 from numpy.polynomial import chebyshev as C
 help(C.chebfit)
 Help on function chebfit in module numpy.polynomial.chebyshev:

 chebfit(x, y, deg, rcond=None, full=False)
     Least squares fit of Chebyshev series to data.

     Fit a Chebyshev series ``p(x) = p[0] * T_{deq}(x) + ... + p[deg] *
     T_{0}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of
     coefficients `p` that minimises the squared error.

     Parameters
     --
     x : array_like, shape (M,)
     x-coordinates of the M sample points ``(x[i], y[i])``.
     y : array_like, shape (M,) or (M, K)
     y-coordinates of the sample points. Several data sets of sample
     points sharing the same x-coordinates can be fitted at once by
     passing in a 2D-array that contains one dataset per column.
 Etc.

  What version of NumPy are you running?

 DG

 On Tue, Feb 9, 2010 at 4:40 PM, josef.p...@gmail.com wrote:

 Similar to the recfunctions, I also don't find the new chebychev
 polynomials in the docs.

 Are they linked from any rst file?

 A search in the online sphinx html docs comes up empty, and

 http://docs.scipy.org/numpy/docs/numpy-docs/reference/routines.poly.rst/#routines-poly
 doesn't link to the new functions.

 The docstrings look nice but maybe nobody sees them.

 Josef
 ___
 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/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.polynomial.chebyshev (not) in the docs

2010-02-09 Thread Charles R Harris
On Tue, Feb 9, 2010 at 7:52 PM, josef.p...@gmail.com wrote:

 On Tue, Feb 9, 2010 at 9:30 PM, David Goldsmith d.l.goldsm...@gmail.com
 wrote:
  Are you talking about absence in the Wiki or absence in a NumPy
 executable.
  They're in the former (I've been editing them), and they're in 1.4.0 of
 the
  latter:

 I have them in numpy 1.4, I see them in the doceditor, but not in

 http://docs.scipy.org/doc/numpy/search.html?q=chebychevcheck_keywords=yesarea=default

 or search for chebfit

 I think they are not added to the html docs because they are not
 referenced in any rst file.
 That's a different issue from having them in the source and the
 doceditor application.


 Josef

 
  import numpy as N
  N.version.version
  '1.4.0'
  from numpy.polynomial import chebyshev as C
  help(C.chebfit)
  Help on function chebfit in module numpy.polynomial.chebyshev:
 
  chebfit(x, y, deg, rcond=None, full=False)
  Least squares fit of Chebyshev series to data.
 
  Fit a Chebyshev series ``p(x) = p[0] * T_{deq}(x) + ... + p[deg] *
  T_{0}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of
  coefficients `p` that minimises the squared error.
 
  Parameters
  --
  x : array_like, shape (M,)
  x-coordinates of the M sample points ``(x[i], y[i])``.
  y : array_like, shape (M,) or (M, K)
  y-coordinates of the sample points. Several data sets of sample
  points sharing the same x-coordinates can be fitted at once by
  passing in a 2D-array that contains one dataset per column.
  Etc.
 
   What version of NumPy are you running?
 


Hey, the error in the docstring prompted me to make another attempt to guess
my editing password. Success! Thanks.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-09 Thread David Cournapeau
Hi,

I am a bit puzzled by the protocol for long(a) where a is a scalar
array. For example, for a = np.float128(1), I was expecting long(a) to
call a.__long__, but it does not look like it is the case. int(a) does
not call a.__int__ either. Where does the long conversion happen in
numpy for scalar arrays ?

cheers,

David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-09 Thread Charles R Harris
On Tue, Feb 9, 2010 at 11:12 PM, David Cournapeau courn...@gmail.comwrote:

 Hi,

 I am a bit puzzled by the protocol for long(a) where a is a scalar
 array. For example, for a = np.float128(1), I was expecting long(a) to
 call a.__long__, but it does not look like it is the case. int(a) does
 not call a.__int__ either. Where does the long conversion happen in
 numpy for scalar arrays ?


How did you tell, did you have print statements in the call? I'm curious if
np.long the same as long?

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion