Re: [Tutor] Most efficient way to read large csv files with properly converted mixed data types.

2016-06-25 Thread Alan Gauld via Tutor
On 25/06/16 08:04, Ek Esawi wrote: > genfromtxt or (2) looping through each line in the file and split, strip, > and assign data type to each entry. > > I am wondering if there is a better and more efficient alternative, > especially to method 2 without using numpy or pandas. The csv module wil

Re: [Tutor] For-else... Any other handy constructs hiding in Python?

2016-06-25 Thread Michael Selik
On Fri, Jun 24, 2016 at 11:58 AM Alex Hall wrote: > I know loops, comprehensions, ifs, and the like, > but I never knew for-else was available. Are there other constructs that I > may have missed? > Are you familiar with context managers? https://www.python.org/dev/peps/pep-0343/ ___

[Tutor] Most efficient way to read large csv files with properly converted mixed data types.

2016-06-25 Thread Ek Esawi
Hi All-- My work involves reading large csv files with mixed data types (integer, float, string, time and date). I was able to accomplish the task using (1) genfromtxt or (2) looping through each line in the file and split, strip, and assign data type to each entry. I am wondering if there is