On 26 February 2016 at 16:46, Ek Esawi wrote:
>
> I used genfromtxt to read a file with multiple data types. The result was a
> 1D array of tuples; for example
>
> [(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200)’]
>
>
>
> I am trying to convert this structured array to a 2D array.
Thanks Peter. It works now. I am trying to be creative but i am still
getting my way around pythony. EKE
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 2/26/2016 7:26 PM, Ek Esawi wrote:
The result i am looking for is a 2D array (matrix) instead of 1D array
of tuples. That's when i read a file using genfromtxt, it generated a 1D
array of n tuples (like the example shown below); each tuple has one row
from the original file. The file contains
Ek Esawi wrote:
> The result i am looking for is a 2D array (matrix) instead of 1D array
> of tuples. That's when i read a file using genfromtxt, it generated a 1D
> array of n tuples (like the example shown below); each tuple has one row
> from the original file. The file contains multiple data t
The result i am looking for is a 2D array (matrix) instead of 1D array
of tuples. That's when i read a file using genfromtxt, it generated a 1D
array of n tuples (like the example shown below); each tuple has one row
from the original file. The file contains multiple data types and so i used
genfro
Peter Otten wrote:
> Or try
>
> b = numpy.array(a, dtype=(object, object))
That won't work, I accidentally tested it on an already converted array :(
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.p
Ek Esawi wrote:
> Thanks for the input. I tried your idea but i did not work; l got 1D array
> of tuples; the same as the original array. I think b/c genfromtxt creates
> an array and so it's already an array object-if i understand it correctly.
> Your idea works well for a list which i tested but
On Feb 26, 2016 9:29 AM, "Ek Esawi" wrote:
>
> Hi All—
>
>
>
> I used genfromtxt to read a file with multiple data types. The result was
a
> 1D array of tuples; for example
>
> [(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200)’]
>
>
>
> I am trying to convert this structured array t
Thanks for the input. I tried your idea but i did not work; l got 1D array
of tuples; the same as the original array. I think b/c genfromtxt creates
an array and so it's already an array object-if i understand it correctly.
Your idea works well for a list which i tested but i want to an n x n 2D
ar
Ek Esawi wrote:
> I used genfromtxt to read a file with multiple data types. The result was
> a 1D array of tuples; for example
>
> [(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200)’]
>
>
>
> I am trying to convert this structured array to a 2D array. Is this
> possible where th
Hi All—
I used genfromtxt to read a file with multiple data types. The result was a
1D array of tuples; for example
[(1, 2, 3), (‘a’, b’, ’c’), (‘12/12/2009’, ’2/4/2014’, ‘3/4/200)’]
I am trying to convert this structured array to a 2D array. Is this
possible where the data types in the 1D a
11 matches
Mail list logo