2 i/o questions and an announcement

2 really quick questions and an announcement of sorts: 1) Is NumPy v2.0 going to address binary file io at all? Right now, I use the array module with the "fromfile" method, but this then has to be re-cast to a NumPy array, which seems inefficient (although I've no evidence for that), especially for large 50-100 meg data files. 2) Is there a quicker way to get data from PIL to NumPy than: data = array(Image.open(...).getdata(), typecode=Int) this takes an eternity for a decent sized image (1.5 minutes on a P400 for a 1200x1000 image). Some of you may already know, but I've taken a first crack at an free clone of IDL (as in RSI's Interactive Data Language, which has similarities to MatLab). Cohesive integration of 2D plotting/contouring (Dislin), 8/24-bit imaging (PIL) and array arithmetic (NumPy) has been implemented using standard IDL syntax - http://nickbower.com/computer/pydl Cheers, nick.

I should have been more specific <:) This problem was related to the current version of NumPy's interaction with PIUL.
Regarding IO the pickling of arrays is quite fast. Have you tried this already?
So is array.fromfile (faster I would expect). The issue at hand is not the read speed, but avoiding reading into memory then re-copying it over to NumPy formats.
Ah-ha! Sounds exactly what I wanted. I'll check it out. Thanks, Nick.

I should have been more specific <:) This problem was related to the current version of NumPy's interaction with PIUL.
Regarding IO the pickling of arrays is quite fast. Have you tried this already?
So is array.fromfile (faster I would expect). The issue at hand is not the read speed, but avoiding reading into memory then re-copying it over to NumPy formats.
Ah-ha! Sounds exactly what I wanted. I'll check it out. Thanks, Nick.
participants (2)
-
Janko Hauser
-
nick@nickbower.com