On 11/11/2015 18:38, Sebastian Berg wrote:
Sounds fine to me, and considering the squeeze logic (which I think is
unfortunate, but it is not something you can easily change), I would be
for simply adding logic to accept a single integral argument and
otherwise not change anything.
[...]
As
On Di, 2015-11-10 at 17:39 +0100, Irvin Probst wrote:
> On 10/11/2015 16:52, Daπid wrote:
> > 42, is exactly the same as (42,) If you want a tuple of
> > tuples, you have to do ((42,),), but then it raises: TypeError: list
> > indices must be integers, not tuple.
>
> My bad, I wrote
Just pointing out np.loadtxt(..., ndmin=2) will always return a 2D array.
Notice that without that option, the result is effectively squeezed. So if
you don't specify that option, and you load up a CSV file with only one
row, you will get a very differently shaped array than if you load up a CSV
On Di, 2015-11-10 at 10:24 -0500, Benjamin Root wrote:
> Just pointing out np.loadtxt(..., ndmin=2) will always return a 2D
> array. Notice that without that option, the result is effectively
> squeezed. So if you don't specify that option, and you load up a CSV
> file with only one row, you will
On 10/11/2015 14:17, Sebastian Berg wrote:
Actually, it is the "sequence special case" type ;). (matlab does not
have this, since matlab always returns 2-D I realized).
As I said, if usecols is like indexing, the result should mimic:
arr = np.loadtxt(f)
arr = arr[usecols]
in which case a 1-D
On 10 November 2015 at 16:07, Irvin Probst
wrote:
> I know this new behavior might break a lot of existing code as
> usecol=(42,) used to return a 1-D array, but usecol=42, also
> returns a 1-D array so the current behavior is not consistent imho.
On 10/11/2015 16:52, Daπid wrote:
42, is exactly the same as (42,) If you want a tuple of
tuples, you have to do ((42,),), but then it raises: TypeError: list
indices must be integers, not tuple.
My bad, I wrote that too fast, please forget this.
I think loadtxt should be a tool to
On Mo, 2015-11-09 at 20:36 +0100, Ralf Gommers wrote:
>
>
> On Mon, Nov 9, 2015 at 7:42 PM, Benjamin Root
> wrote:
> My personal rule for flexible inputs like that is that it
> should be encouraged so long as it does not introduce
> ambiguity.
On 10/11/2015 09:19, Sebastian Berg wrote:
since a scalar row (so just one row) is read and not a 2D array. I tend
to say it should be an array-like argument and not a generalized
sequence argument, just wanted to note that, since I am not sure what
matlab does.
Hi,
By default Matlab reads
On Di, 2015-11-10 at 10:24 +0100, Irvin Probst wrote:
> On 10/11/2015 09:19, Sebastian Berg wrote:
> > since a scalar row (so just one row) is read and not a 2D array. I tend
> > to say it should be an array-like argument and not a generalized
> > sequence argument, just wanted to note that, since
My personal rule for flexible inputs like that is that it should be
encouraged so long as it does not introduce ambiguity. Furthermore,
Allowing a scalar as an input doesn't add a congitive disconnect on the
user on how to specify multiple columns. Therefore, I'd give this a +1.
On Mon, Nov 9,
On Mon, Nov 9, 2015 at 7:42 PM, Benjamin Root wrote:
> My personal rule for flexible inputs like that is that it should be
> encouraged so long as it does not introduce ambiguity. Furthermore,
> Allowing a scalar as an input doesn't add a congitive disconnect on the
> user
Hi,
I've recently seen many students, coming from Matlab, struggling against
the usecols argument of loadtxt. Most of them tried something like:
loadtxt("foo.bar", usecols=2) or the ones with better documentation
reading skills tried loadtxt("foo.bar", usecols=(2)) but none of them
understood
On 31 May 2011, at 21:28, Pierre GM wrote:
On May 31, 2011, at 6:37 PM, Derek Homeier wrote:
On 31 May 2011, at 18:25, Pierre GM wrote:
On May 31, 2011, at 5:52 PM, Derek Homeier wrote:
I think stuff like multiple delimiters should have been dealt with
before, as the right place to insert
Derek Homeier wrote:
Hi Chris,
On 31 May 2011, at 13:56, cgraves wrote:
I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin
option,
however neither genfromtxt nor recfromtxt, which use loadtxt, have it.
Should they have inherited the option? Who can make it happen?
Ralf Gommers-2 wrote:
On Fri, May 6, 2011 at 12:57 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 6 May 2011, at 07:53, Ralf Gommers wrote:
Looks okay, and I agree that it's better to fix it now. The timing
is a bit unfortunate though, just after RC2. I'll
Hi Chris,
On 31 May 2011, at 13:56, cgraves wrote:
I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin
option,
however neither genfromtxt nor recfromtxt, which use loadtxt, have it.
Should they have inherited the option? Who can make it happen?
you are mistaken, genfromtxt
On May 31, 2011, at 4:53 PM, Derek Homeier wrote:
Hi Chris,
On 31 May 2011, at 13:56, cgraves wrote:
I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin
option,
however neither genfromtxt nor recfromtxt, which use loadtxt, have it.
Should they have inherited the
On 05/31/2011 10:18 AM, Pierre GM wrote:
On May 31, 2011, at 4:53 PM, Derek Homeier wrote:
Hi Chris,
On 31 May 2011, at 13:56, cgraves wrote:
I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin
option,
however neither genfromtxt nor recfromtxt, which use loadtxt, have it.
On Tue, May 31, 2011 at 10:33 AM, Bruce Southey bsout...@gmail.com wrote:
On 05/31/2011 10:18 AM, Pierre GM wrote:
On May 31, 2011, at 4:53 PM, Derek Homeier wrote:
Hi Chris,
On 31 May 2011, at 13:56, cgraves wrote:
I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin
On 31 May 2011, at 17:33, Bruce Southey wrote:
It certainly would make sense to provide the same functionality for
genfromtxt (which should then be inherited by [nd,ma,rec]fromtxt),
so
I'd go ahead and file a feature (enhancement) request. I can't
promise
I can take care of it myself,
On 31 May 2011, at 17:45, Benjamin Root wrote:
At this point, I wonder if it might be smarter to create
a .atleast_Nd() function and use that everywhere it is needed.
Having similar logic tailored for each loading function might be a
little dangerous if bug fixes are made to one, but
On May 31, 2011, at 5:52 PM, Derek Homeier wrote:
I think stuff like multiple delimiters should have been dealt with
before, as the right place to insert the ndmin code (which includes
the decision to squeeze or not to squeeze as well as to add additional
dimensions, if required)
On 31 May 2011, at 18:25, Pierre GM wrote:
On May 31, 2011, at 5:52 PM, Derek Homeier wrote:
I think stuff like multiple delimiters should have been dealt with
before, as the right place to insert the ndmin code (which includes
the decision to squeeze or not to squeeze as well as to add
On May 31, 2011, at 6:37 PM, Derek Homeier wrote:
On 31 May 2011, at 18:25, Pierre GM wrote:
On May 31, 2011, at 5:52 PM, Derek Homeier wrote:
I think stuff like multiple delimiters should have been dealt with
before, as the right place to insert the ndmin code (which includes
the
On Fri, May 6, 2011 at 12:57 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 6 May 2011, at 07:53, Ralf Gommers wrote:
Looks okay, and I agree that it's better to fix it now. The timing
is a bit unfortunate though, just after RC2. I'll have closer look
tomorrow and
On 6 May 2011, at 07:53, Ralf Gommers wrote:
Looks okay, and I agree that it's better to fix it now. The timing
is a bit unfortunate though, just after RC2. I'll have closer look
tomorrow and if it can go in, probably tag RC3.
If in the meantime a few more people could test this, that
On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 4. mai 2011, at 20.33, Benjamin Root wrote:
On Wed, May 4, 2011 at 7:54 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote:
But:
On Thu, May 5, 2011 at 10:49 AM, Benjamin Root ben.r...@ou.edu wrote:
On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 4. mai 2011, at 20.33, Benjamin Root wrote:
On Wed, May 4, 2011 at 7:54 PM, Derek Homeier
On 5. mai 2011, at 08.49, Benjamin Root wrote:
On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 4. mai 2011, at 20.33, Benjamin Root wrote:
On Wed, May 4, 2011 at 7:54 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On
On Thu, May 5, 2011 at 1:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 5. mai 2011, at 08.49, Benjamin Root wrote:
On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 4. mai 2011, at 20.33, Benjamin Root wrote:
On Wed, May
On Thu, May 5, 2011 at 9:18 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, May 5, 2011 at 1:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 5. mai 2011, at 08.49, Benjamin Root wrote:
On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com
On Thu, May 5, 2011 at 2:33 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote:
On Thu, May 5, 2011 at 9:18 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, May 5, 2011 at 1:08 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 5. mai 2011, at 08.49, Benjamin Root wrote:
On Thu, May 5, 2011 at 9:46 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, May 5, 2011 at 2:33 PM, Ralf Gommers
ralf.gomm...@googlemail.comwrote:
On Thu, May 5, 2011 at 9:18 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, May 5, 2011 at 1:08 PM, Paul Anton Letnes
On 5 May 2011, at 22:53, Derek Homeier wrote:
However, the problem that ndmin is supposed to address is not fixed
by the current implementation for the rc. Essentially, a single-
row, multi-column file with ndmin=2 comes out as a Nx1 array which
is the same result for a multi-row,
On Fri, May 6, 2011 at 12:12 AM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 5 May 2011, at 22:53, Derek Homeier wrote:
However, the problem that ndmin is supposed to address is not fixed
by the current implementation for the rc. Essentially, a single-
row,
Hi Paul,
I've got back to your suggestion re. the ndmin flag for loadtxt from a few
weeks ago...
On 27.03.2011, at 12:09PM, Paul Anton Letnes wrote:
1562:
I attach a possible patch. This could also be the default
behavior to my mind, since the function caller can simply call
On 4. mai 2011, at 17.34, Derek Homeier wrote:
Hi Paul,
I've got back to your suggestion re. the ndmin flag for loadtxt from a few
weeks ago...
On 27.03.2011, at 12:09PM, Paul Anton Letnes wrote:
1562:
I attach a possible patch. This could also be the default
behavior to my mind,
On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote:
But: Isn't the numpy.atleast_2d and numpy.atleast_1d functions written for
this? Shouldn't we reuse them? Perhaps it's overkill, and perhaps it will
reintroduce the 'transposed' problem?
Yes, good point, one could replace the
X.shape =
On Wed, May 4, 2011 at 7:54 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote:
But: Isn't the numpy.atleast_2d and numpy.atleast_1d functions written
for this? Shouldn't we reuse them? Perhaps it's overkill, and perhaps it
will
On 4. mai 2011, at 20.33, Benjamin Root wrote:
On Wed, May 4, 2011 at 7:54 PM, Derek Homeier
de...@astro.physik.uni-goettingen.de wrote:
On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote:
But: Isn't the numpy.atleast_2d and numpy.atleast_1d functions written for
this? Shouldn't we
On 03/31/2011 12:02 PM, Derek Homeier wrote:
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
This is an invalid ticket because the docstring clearly states that in
3 different, yet critical places, that missing values are not handled
here:
Each row in the text file must have the same number
On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com wrote:
On 03/31/2011 12:02 PM, Derek Homeier wrote:
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
This is an invalid ticket because the docstring clearly states that in
3 different, yet critical places, that missing values
On 04/04/2011 11:20 AM, Charles R Harris wrote:
On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com
mailto:bsout...@gmail.com wrote:
On 03/31/2011 12:02 PM, Derek Homeier wrote:
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
This is an invalid ticket because
On Mon, Apr 4, 2011 at 11:01 AM, Bruce Southey bsout...@gmail.com wrote:
On 04/04/2011 11:20 AM, Charles R Harris wrote:
On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com wrote:
On 03/31/2011 12:02 PM, Derek Homeier wrote:
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
On Thu, Mar 31, 2011 at 4:53 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 26. mars 2011, at 21.44, Derek Homeier wrote:
Hi Paul,
having had a look at the other tickets you dug up,
My
On Wed, Mar 30, 2011 at 9:53 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 26. mars 2011, at 21.44, Derek Homeier wrote:
Hi Paul,
having had a look at the other tickets you dug up,
On Thu, Mar 31, 2011 at 5:03 PM, Bruce Southey bsout...@gmail.com wrote:
On Wed, Mar 30, 2011 at 9:53 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 26. mars 2011, at 21.44, Derek Homeier wrote:
On 03/31/2011 10:08 AM, Ralf Gommers wrote:
On Thu, Mar 31, 2011 at 5:03 PM, Bruce Southeybsout...@gmail.com wrote:
On Wed, Mar 30, 2011 at 9:53 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
This is an invalid ticket because the docstring clearly states that in
3 different, yet critical places, that missing values are not handled
here:
Each row in the text file must have the same number of values.
genfromtxt : Load data with
On 03/31/2011 12:02 PM, Derek Homeier wrote:
On 31 Mar 2011, at 17:03, Bruce Southey wrote:
This is an invalid ticket because the docstring clearly states that in
3 different, yet critical places, that missing values are not handled
here:
Each row in the text file must have the same number
On Thu, Mar 31, 2011 at 8:42 AM, Ralf Gommers
ralf.gomm...@googlemail.comwrote:
On Thu, Mar 31, 2011 at 4:53 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
snip
If you look in Trac under
On Sun, Mar 27, 2011 at 4:09 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
On 26. mars 2011, at 21.44, Derek Homeier wrote:
Hi Paul,
having had a look at the other tickets you dug up,
My opinions are my own, and in detail, they are:
1752:
I attach a possible patch.
On Sun, Mar 27, 2011 at 12:09 PM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
I am sure someone has been using this functionality to convert floats to
ints. Changing will break their code. I am not sure how big a deal that would
be. Also, I am of the opinion that one should _first_
On 26. mars 2011, at 21.44, Derek Homeier wrote:
Hi Paul,
having had a look at the other tickets you dug up,
My opinions are my own, and in detail, they are:
1752:
I attach a possible patch. FWIW, I agree with the request. The
patch is written to be compatible with the fix in
Hi!
I have had a look at the list of numpy.loadtxt tickets. I have never
contributed to numpy before, so I may be doing stupid things - don't be afraid
to let me know!
My opinions are my own, and in detail, they are:
1752:
I attach a possible patch. FWIW, I agree with the request. The
Hi,
Thanks!
On Sat, 26 Mar 2011 13:11:46 +0100, Paul Anton Letnes wrote:
[clip]
I hope you find this useful! Is there some way of submitting the patches
for review in a more convenient fashion than e-mail?
You can attach them on the trac to each ticket. That way they'll be easy
to find later
Hi,
On 26 Mar 2011, at 14:36, Pauli Virtanen wrote:
On Sat, 26 Mar 2011 13:11:46 +0100, Paul Anton Letnes wrote:
[clip]
I hope you find this useful! Is there some way of submitting the
patches
for review in a more convenient fashion than e-mail?
You can attach them on the trac to each
Hi again,
On 26 Mar 2011, at 15:20, Derek Homeier wrote:
1562:
I attach a possible patch. This could also be the default
behavior to my mind, since the function caller can simply call
numpy.squeeze if needed. Changing default behavior would probably
break old code,
Seems the fastest
Hi Derek!
On 26. mars 2011, at 15.48, Derek Homeier wrote:
Hi again,
On 26 Mar 2011, at 15:20, Derek Homeier wrote:
1562:
I attach a possible patch. This could also be the default
behavior to my mind, since the function caller can simply call
numpy.squeeze if needed. Changing default
On Sat, Mar 26, 2011 at 8:53 AM, Paul Anton Letnes
paul.anton.let...@gmail.com wrote:
Hi Derek!
On 26. mars 2011, at 15.48, Derek Homeier wrote:
Hi again,
On 26 Mar 2011, at 15:20, Derek Homeier wrote:
1562:
I attach a possible patch. This could also be the default
behavior to
Hi Paul,
having had a look at the other tickets you dug up,
My opinions are my own, and in detail, they are:
1752:
I attach a possible patch. FWIW, I agree with the request. The
patch is written to be compatible with the fix in ticket #1562, but
I did not test that yet.
Tested, see
Hi All,
Could someone with an interest in loadtxt/savetxt look through the
associated tickets? A search on the tickets using either of those keys will
return fairly lengthy lists.
Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
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
Hi,
I been looking around and could spot anything on this. Quite often I want to
read a homogeneous block of data from within a file. The skiprows option is
great for missing out the section before the data starts, but if there is
anything below then loadtxt will choke. I wondered if there
oops, I meant to save my post but I sent it instead - doh!
In the end, the question was; is worth adding start= and stop= markers into
loadtxt to allow grabbing sections of a file between two known headers? I
imagine it's something that people come up against regularly.
Thanks,
Neil
On Sep 17, 2010, at 2:40 PM, Neil Hodgson wrote:
oops, I meant to save my post but I sent it instead - doh!
In the end, the question was; is worth adding start= and stop= markers into
loadtxt to allow grabbing sections of a file between two known headers? I
imagine it's something that
Neil Hodgson wrote:
In the end, the question was; is worth adding start= and stop= markers
into loadtxt to allow grabbing sections of a file between two known
headers? I imagine it's something that people come up against regularly.
maybe not so regular. However, a common use would be to be
In the end, the question was; is worth adding start= and stop=
markers
into loadtxt to allow grabbing sections of a file between two known
headers? I imagine it's something that people come up against
regularly.
Simple enough to wrap your file in a new file-like object that stops
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
On Fri, Sep 17, 2010 at 2:50 PM, Zachary Pincus zachary.pin...@yale.eduwrote:
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:
On Sep 17, 2010, at 3:59 PM, Benjamin Root wrote:
So, this code will still raise an error for an empty file.
Personally, I consider that a bug because I would expect to receive
an empty array. I could understand raising an error for a non-empty
file that does not contain anything
On Fri, Sep 17, 2010 at 3:04 PM, Zachary Pincus zachary.pin...@yale.eduwrote:
On Sep 17, 2010, at 3:59 PM, Benjamin Root wrote:
So, this code will still raise an error for an empty file.
Personally, I consider that a bug because I would expect to receive
an empty array. I could
On Thu, Jun 24, 2010 at 1:53 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jun 24, 2010 at 1:00 PM, Warren Weckesser
warren.weckes...@enthought.com wrote:
Benjamin Root wrote:
Hi,
I was having the hardest time trying to figure out an intermittent bug
in one of my programs.
Hi,
I was having the hardest time trying to figure out an intermittent bug in
one of my programs. Essentially, in some situations, it was throwing an
error saying that the array object was not an array. It took me a while,
but then I figured out that my program was assuming that the object
Benjamin Root wrote:
Hi,
I was having the hardest time trying to figure out an intermittent bug
in one of my programs. Essentially, in some situations, it was
throwing an error saying that the array object was not an array. It
took me a while, but then I figured out that my program was
Warren Weckesser wrote:
Benjamin Root wrote:
Note that this isn't restricted to structured arrays. For regular
ndarrays, loadtxt() appears to mimic the behavior of np.squeeze():
Exactly. The last four lines of the function are:
X = np.squeeze(X)
if unpack:
return X.T
On Thu, Jun 24, 2010 at 1:00 PM, Warren Weckesser
warren.weckes...@enthought.com wrote:
Benjamin Root wrote:
Hi,
I was having the hardest time trying to figure out an intermittent bug
in one of my programs. Essentially, in some situations, it was
throwing an error saying that the
Hello everybody,
I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt') raised
an exception:
import numpy as np
np.loadtxt('foo.txt')
Traceback (most recent call last):
File stdin, line 1, in module
File
On Mon, May 24, 2010 at 4:14 PM, Maria Liukis liu...@usc.edu wrote:
Hello everybody,
I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt')
raised an exception:
import numpy as np
np.loadtxt('foo.txt')
Traceback (most recent call last):
File stdin, line 1, in module
-discussion@scipy.org
Subject: [Numpy-discussion] loadtxt raises an exception on empty file
Hello everybody,
I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt') raised
an exception:
import numpy as np
np.loadtxt('foo.txt')
Traceback (most recent call last):
File stdin, line 1
I am new to python/numpy/scipy and new to this list. I recently
migrated over from using Octave and am very impressed so far!
Recently I needed to load data from a text file and quickly found
numpy's loadtxt function. However, there were missing data values,
which loadtxt does not handle.
On Thu, Feb 11, 2010 at 1:36 AM, Jonathan Stickel jjstic...@vcn.com wrote:
I am new to python/numpy/scipy and new to this list. I recently
migrated over from using Octave and am very impressed so far!
Recently I needed to load data from a text file and quickly found
numpy's loadtxt
Hello,
I'm new to numpy, and considering using loadtxt() to read a data file.
As a starter, I tried the example of the doc page (
http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html) :
from StringIO import StringIO # StringIO behaves like a file object
c = StringIO(0
On Mon, May 4, 2009 at 3:06 PM, bruno Piguet bruno.pig...@gmail.com wrote:
Hello,
I'm new to numpy, and considering using loadtxt() to read a data file.
As a starter, I tried the example of the doc page (
http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html) :
from
On 2/11/2009 6:40 AM, A B wrote:
Hi,
How do I write a loadtxt command to read in the following file and
store each data point as the appropriate data type:
12|h|34.5|44.5
14552|bbb|34.5|42.5
dt = {'names': ('gender','age','weight','bal'), 'formats': ('i4',
'S4','f4', 'f4')}
Does this
On 3/4/2009 12:57 PM, Sturla Molden wrote:
Does this work for you?
Never mind, it seems my e-mail got messed up. I ought to keep them
sorted by date...
S.M.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
On Sun, 1 Mar 2009 14:29:54 -0500, Michael Gilbert wrote:
i will send the current version to the list tomorrow when i have access
to the system that it is on.
attached is my current version of loadtxt. like i said, it's slower
for small data sets (because it reads through the whole data file
So I have some data sets of about 16 floating point numbers stored
in text files. I find that loadtxt is rather slow. Is this to be
expected? Would it be faster if it were loading binary data?
-gideon
___
Numpy-discussion mailing list
On Sun, 1 Mar 2009 16:12:14 -0500 Gideon Simpson wrote:
So I have some data sets of about 16 floating point numbers stored
in text files. I find that loadtxt is rather slow. Is this to be
expected? Would it be faster if it were loading binary data?
i have run into this as well.
On Sun, 1 Mar 2009 14:29:54 -0500 Michael Gilbert wrote:
i have rewritten loadtxt to be smarter about allocating memory, but
it is slower overall and doesn't support all of the original
arguments/options (yet).
i had meant to say that my version is slower for smaller data sets (when
you
On Sun, Mar 1, 2009 at 11:29 AM, Michael Gilbert
michael.s.gilb...@gmail.com wrote:
On Sun, 1 Mar 2009 16:12:14 -0500 Gideon Simpson wrote:
So I have some data sets of about 16 floating point numbers stored
in text files. I find that loadtxt is rather slow. Is this to be
expected?
Gideon Simpson wrote:
So I have some data sets of about 16 floating point numbers stored
in text files. I find that loadtxt is rather slow. Is this to be
expected? Would it be faster if it were loading binary data?
Depending on the format you may be able to use numpy.fromfile, which
On Tue, Feb 10, 2009 at 9:52 PM, Brent Pedersen bpede...@gmail.com wrote:
On Tue, Feb 10, 2009 at 9:40 PM, A B python6...@gmail.com wrote:
Hi,
How do I write a loadtxt command to read in the following file and
store each data point as the appropriate data type:
12|h|34.5|44.5
On Wed, Feb 11, 2009 at 6:27 PM, A B python6...@gmail.com wrote:
On Tue, Feb 10, 2009 at 9:52 PM, Brent Pedersen bpede...@gmail.com wrote:
On Tue, Feb 10, 2009 at 9:40 PM, A B python6...@gmail.com wrote:
Hi,
How do I write a loadtxt command to read in the following file and
store each data
2009/2/12 A B python6...@gmail.com:
Actually, I was using two different machines and it appears that the
version of numpy available on Ubuntu is seriously out of date (1.0.4).
Wonder why ...
See the recent post here
Hi,
How do I write a loadtxt command to read in the following file and
store each data point as the appropriate data type:
12|h|34.5|44.5
14552|bbb|34.5|42.5
Do the strings have to be read in separately from the numbers?
Why would anyone use 'S10' instead of 'string'?
dt = {'names':
On Tue, Feb 10, 2009 at 9:40 PM, A B python6...@gmail.com wrote:
Hi,
How do I write a loadtxt command to read in the following file and
store each data point as the appropriate data type:
12|h|34.5|44.5
14552|bbb|34.5|42.5
Do the strings have to be read in separately from the numbers?
Charles R Harris wrote:
On Tue, Oct 21, 2008 at 1:30 PM, Ryan May [EMAIL PROTECTED] wrote:
Hi,
I noticed numpy.loadtxt has support for gzipped text files, but not for
bz2'd files. Here's a 3 line patch to add bzip2 support to loadtxt.
Ryan
--
Ryan May
Graduate Research Assistant
Hi,
I noticed numpy.loadtxt has support for gzipped text files, but not for
bz2'd files. Here's a 3 line patch to add bzip2 support to loadtxt.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Index: numpy/lib/io.py
1 - 100 of 140 matches
Mail list logo