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 t
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 ever
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 a
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 r
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 said
Hi,
I'm not sure if I should send this here or to scipy-user, feel free to
redirect me there if I'm off topic.
So, there is something I don't understand using inv and lstsq in numpy.
I've built *on purpose* an ill conditioned system to fit a quadric
a*x**2+b*y**2+c*x*y+d*x+e*y+f, the data poi
On 06/04/2016 04:11, Todd wrote:
When you try to transpose a 1D array, it does nothing. This is the
correct behavior, since it transposing a 1D array is meaningless.
However, this can often lead to unexpected errors since this is rarely
what you want. You can convert the array to 2D, using
On Thu, 7 Apr 2016 14:31:17 -0400, josef.p...@gmail.com wrote:
So this discussion brings up that we also need an easy an obvious
way to make a column vector --
maybe:
np.col_vector(arr)
FWIW I would give a +1e42 to something like np.colvect and np.rowvect
(or whatever variant of these name