<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 26, 2018 at 2:35 PM, Allan Haldane <span dir="ltr"><<a href="mailto:allanhaldane@gmail.com" target="_blank">allanhaldane@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As I remember, numpy has some fairly convoluted code for array creation<br>
which tries to make sense of various nested lists/tuples/ndarray<br>
combinations. It makes a difference for structured arrays and object<br>
arrays. I don't remember the details right now, but I know in some cases<br>
the rule is "If it's a Python list, recurse, otherwise assume it is an<br>
object array".<br></blockquote><div><br></div><div>that's at least explainable, and the "try to figure out what the user means" array cratinon is pretty much an impossible problem, so what we've got is probably about as good as it can get.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>     These points make me think that instead of a `.totuple` method, this<br>
>     might be more suitable as a new function in np.lib.recfunctions.<br>
><br>
> I don't seem to have that module -- and I'm running 1.14.0 -- is this a<br>
> new idea?<br>
<br>
Sorry, I didn't specify it correctly. It is "numpy.lib.recfunctions".<br></blockquote><div><br></div><div>thanks -- found it. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also, the functions in that module encourage "pandas-like" use of<br>
structured arrays, but I'm not sure they should be used that way. I've<br>
been thinking they should be primarily used for binary interfaces<br>
with/to numpy, eg to talk to C programs or to read complicated binary files.<br></blockquote><div><br></div><div>that's my use-case. And I agree -- if you really want to do that kind of thing, pandas is the way to go.</div><div><br></div><div>I thought recarrays were pretty cool back in the day, but pandas is a much better option.</div><div><br></div><div>So I pretty much only use structured arrays for data exchange with C code....</div><div><br></div><div>-CHB</div><div> </div></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>