473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

importing a csv file as a Numeric array

What's a good way of importing a csv text file of floats into a
Numeric array? I tried the csv module and it seems to work well so
long as I've ints. Does anyone have any suggestions / snippets that
work to import a csv file of floats into a Numeric array?

-Rahul
Mar 25 '08 #1
1 1993
En Tue, 25 Mar 2008 06:46:57 -0300, Rahul <rp*****@gmail.comescribió:
What's a good way of importing a csv text file of floats into a
Numeric array? I tried the csv module and it seems to work well so
long as I've ints. Does anyone have any suggestions / snippets that
work to import a csv file of floats into a Numeric array?
See the Cookbook at http://www.scipy.org/Cookbook/InputOutput - but I
don't know how much of that is applicable to the old Numeric library.
Robert Kern posted a fairly generic approach in this thread
http://groups.google.com/group/comp....5c364cae59127/

--
Gabriel Genellina

Mar 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: deko | last post by:
Do I need to use flock() when reading a file into an array? It's possible that the file in question could be open at the time the file('filename') request is made. I realize flock() is required...
0
by: Phil | last post by:
Hi, I don't understand this strange behaviour: I compile this code : #include <Python.h> #include"Numeric/arrayobject.h" static PyObject *
0
by: beliavsky | last post by:
You create a 1-D Numeric array of n floats with x = zeros(n,Float) How do you create a Numeric array of n instances of class 'xy', where for example xy is defined as follows: class xy: def...
1
by: Nicolas Pernetty | last post by:
Hello, I'm trying to find a clear and fast equivalent to the index method of plain python list : >> a = >> a.index(4) 2 I have to use it on a Numeric array, so the best I've come up with...
4
by: steve | last post by:
I want to set all elements in a numeric array to a value other than 0. The default numeric initialisers set the elements to 0. Is looped assignment the fastest way, or is there an equivalent to the...
1
by: ajikoe | last post by:
hello, I found that if I use Numeric.array into unittest it is not consistance, Is that normal ? import Numeric class myTest(unittest.TestCase): def runTest(self): a = Numeric.array()
2
by: Kelly | last post by:
Hi all, I am trying without much success to understand someone else's VB program. To make things a little easier to compare side by side, I wanted to print some of the variables being used...
3
by: wesley1970 | last post by:
<?php $a = array(1,2,3,4,5); $b = array(1,2,3,4,5,6,7,8); echo array_intersect($a, $b); ?> array_intersect should return the numbers of items intersect in 2 arrays. In this case, it...
14
by: lashaw | last post by:
This program display a names. If the name you type match the one asked to type, the program tells you the phone number of the name. The problem is it only list the last name in the file. How to get...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.