Paul Probert wrote:
>I'm trying to write numpy arrays as binary data, to support a legacy
> file format. So I open a file and write to it:
>
> fp = open('somefile','w')
> ...
> oldpos = fp.tell()
> somenumpyarray.tofile(fp)
> newpos = fp.tell()
> diff = newpos - oldpos - somenumpyarray.nbyte
All,
I'm trying to write numpy arrays as binary data, to support a legacy
file format. So I open a file and write to it:
fp = open('somefile','w')
...
oldpos = fp.tell()
somenumpyarray.tofile(fp)
newpos = fp.tell()
diff = newpos - oldpos - somenumpyarray.nbytes
if diff != 0:
print 'ahhah!
On Wed, Jul 28, 2010 at 12:36 PM, Fernando Perez wrote:
> The official Python 2.x unicode story is well explained here:
> http://docs.python.org/howto/unicode.html
>
> and here is the corresponding document for 3.x:
> http://docs.python.org/release/3.1.2/howto/unicode.html
Just in case you're sti
>
>> I'll call this a bug in NumPy's broadcasting. "x == 1" should have
>> returned:
>
> This is probably related:
>
>
> In [22]: a = np.array(['a','b'])
>
> In [23]: a + 'c'
> ---
> TypeError Tr
> I'll call this a bug in NumPy's broadcasting. "x == 1" should have
> returned:
This is probably related:
In [22]: a = np.array(['a','b'])
In [23]: a + 'c'
---
TypeError Traceback (most rec
> In [15]: x = np.array(['a', 'b'])
>
> In [16]: x == 'a' # this was what I expected
> Out[16]: array([ True, False], dtype=bool)
>
> In [17]: x == 1 # this was strange to me
> Out[17]: False
>
> Is it easy to explain why this is?
I'll call this a bug in NumPy's broadcasting. "x == 1" should ha
I think this is just Python behavior; comparing python ints and strs also
gives False:
In [45]: 8 == 'L'
Out[45]: False
On Wed, Jul 28, 2010 at 6:42 PM, Matthew Brett wrote:
> Hi,
>
> Please forgive me if this is obvious, but this surprised me:
>
> In [15]: x = np.array(['a', 'b'])
>
> In [16]:
Hi,
Please forgive me if this is obvious, but this surprised me:
In [15]: x = np.array(['a', 'b'])
In [16]: x == 'a' # this was what I expected
Out[16]: array([ True, False], dtype=bool)
In [17]: x == 1 # this was strange to me
Out[17]: False
Is it easy to explain why this is?
Thanks a lot,
On Wed, Jul 28, 2010 at 12:36 AM, Sandro Tosi wrote:
> On Tue, Jul 27, 2010 at 14:52, Sandro Tosi wrote:
>> Hi,
>>
>> On Tue, Jul 27, 2010 at 12:28, David Cournapeau wrote:
>>> On Tue, Jul 20, 2010 at 3:44 AM, Sandro Tosi wrote:
>>>
ah if you say so, I trust you :)
>>>
>>> Could you try th
On Jul 28, 2010, at 7:52 PM, Pauli Virtanen wrote:
> Wed, 28 Jul 2010 18:43:30 -0400, Pierre GM wrote:
> [clip]
>> Mmh. I did create a PyMappingMethod structure called MyArray_as_mapping,
>> and MyArray_as_mapping.mp_subscript points to the function that I want
>> to use. However, I'd like the My
> Mon, 26 Jul 2010 23:58:11 +0800, Ralf Gommers wrote:
> Is the current algorithm in the trunk the ziggurat one, or the previous
> one? IIRC, the problem was that the ziggurat broke reproducibility of
> random numbers with a given seed.
Ziggurat (in Enthought) did not break reproducibility but ba
Wed, 28 Jul 2010 18:43:30 -0400, Pierre GM wrote:
[clip]
> Mmh. I did create a PyMappingMethod structure called MyArray_as_mapping,
> and MyArray_as_mapping.mp_subscript points to the function that I want
> to use. However, I'd like the MyArray_as_mapping.length and
> MyArray.mp_ass_subscript to po
Thu, 29 Jul 2010 01:16:14 +0200, Sturla Molden wrote:
[clip]
>> Makes sense. But couldn't a ``dtype`` argument still be useful?
>
> np.ceil(some_array).astype(int)
That's one temporary more. The dtype= argument for all ufuncs wouldn't
probably hurt too much.
--
Pauli Virtanen
___
>> Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote:
>>> > I don't understand why ceil and floor return real values [snip]
>>> > Wouldn't an integer make more sense?
>
>
> On 7/28/2010 9:39 AM, Pauli Virtanen wrote:
>> Which integer? Only arbitrary-size integers (Python longs) are able to
>> sp
On Jul 28, 2010, at 5:52 PM, Travis Oliphant wrote:
>
> On Jul 26, 2010, at 11:58 AM, Pierre GM wrote:
>
>> All,
>> I'm teaching myself how to subclass ndarrays in C (not in Cython, just plain
>> C). It's slowly coming together, but I'm now running into a problem: I need
>> to overwrite __get
On Jul 26, 2010, at 11:58 AM, Pierre GM wrote:
> All,
> I'm teaching myself how to subclass ndarrays in C (not in Cython, just plain
> C). It's slowly coming together, but I'm now running into a problem: I need
> to overwrite __getitem__ and I'm not sure how to do it. I was thinking about
> us
On Wed, Jul 28, 2010 at 16:21, Pauli Virtanen wrote:
> Mon, 26 Jul 2010 23:58:11 +0800, Ralf Gommers wrote:
> [clip]
>> If you have urgent tickets, please let's hear those as well. My small
>> laundry list is pasted below.
>
> Was something done to the Gaussian random generator?
>
> Is the current
Mon, 26 Jul 2010 23:58:11 +0800, Ralf Gommers wrote:
[clip]
> If you have urgent tickets, please let's hear those as well. My small
> laundry list is pasted below.
Was something done to the Gaussian random generator?
Is the current algorithm in the trunk the ziggurat one, or the previous
one? II
2010/7/28 Ken Watford :
> 2010/7/28 脑关生命科学仪器 :
>> it seems like pytable only support HDF5. I had some 500GB numerical arrays
>> to process. Pytable claims to have some advance feature to enhance
>> processing speed and largely reduce physical memory requirement. However, I
>> do not wanna touch the
2010/7/28 脑关生命科学仪器 :
> it seems like pytable only support HDF5. I had some 500GB numerical arrays
> to process. Pytable claims to have some advance feature to enhance
> processing speed and largely reduce physical memory requirement. However, I
> do not wanna touch the raw data I had. Simply becaus
Francesc Alted wrote:
> A Wednesday 28 July 2010 18:05:11 脑关(BrainGateway)生命科学仪器 escrigué:
>> I had some 500GB numerical arrays
>> to process. Pytable claims to have some advance feature to enhance
>> processing speed and largely reduce physical memory requirement. However, I
>> do not wanna touch
On Tue, Jul 27, 2010 at 7:42 AM, Sebastian Haase wrote:
> The origin of this problem is the fact that Python supports (at least)
> 2 types of Unicode:
> 2 bytes and/or 4 bytes per character.
It only supports those two, and that's purely an internal
implementation detail. Python can encode unicod
Thanks, I did almost the same yesterday and now everything works fine.
On Wed, Jul 28, 2010 at 4:29 AM, Sebastian Haase wrote:
> You should be allowed to remove anything in /usr/local without fear to
> kill your operation system.
> In case you miss python2.5 afterwards, you should be able to just
On Wed, Jul 28, 2010 at 11:48, Alan G Isaac wrote:
>> Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote:
>>> > I don't understand why ceil and floor return real values [snip]
>>> > Wouldn't an integer make more sense?
>
> On 7/28/2010 9:39 AM, Pauli Virtanen wrote:
>> Which integer? Only arbitr
Thank you -- just what I was looking for.
On Wed, Jul 28, 2010 at 11:39 AM, Benjamin Root wrote:
> On Wed, Jul 28, 2010 at 7:43 AM, wheres pythonmonks
> wrote:
>>
>> I have a rec array and I want to add an additional column.
>>
>> I've seen at least two solutions to this problem:
>>
>> mlab.re
> Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote:
>> > I don't understand why ceil and floor return real values [snip]
>> > Wouldn't an integer make more sense?
On 7/28/2010 9:39 AM, Pauli Virtanen wrote:
> Which integer? Only arbitrary-size integers (Python longs) are able to
> span the wh
A Wednesday 28 July 2010 18:05:11 脑关(BrainGateway)生命科学仪器 escrigué:
> it seems like pytable only support HDF5. I had some 500GB numerical arrays
> to process. Pytable claims to have some advance feature to enhance
> processing speed and largely reduce physical memory requirement. However, I
> do not
2010/7/28 脑关生命科学仪器 :
> it seems like pytable only support HDF5. I had some 500GB numerical arrays
> to process. Pytable claims to have some advance feature to enhance
> processing speed and largely reduce physical memory requirement. However, I
> do not wanna touch the raw data I had. Simply becaus
it seems like pytable only support HDF5. I had some 500GB numerical arrays
to process. Pytable claims to have some advance feature to enhance
processing speed and largely reduce physical memory requirement. However, I
do not wanna touch the raw data I had. Simply because I do not have doubled
disks
On Wed, Jul 28, 2010 at 7:43 AM, wheres pythonmonks <
wherespythonmo...@gmail.com> wrote:
> I have a rec array and I want to add an additional column.
>
> I've seen at least two solutions to this problem:
>
> mlab.rec_append_fields (matplotlib)
>
> And append_field from
> http://mail.scipy.org/pip
Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote:
> I don't understand why ceil and floor return real values, while the doc
> string says:
>
> The ceil of the scalar `x` is the smallest integer `i`
>
> Wouldn't an integer make more sense?
Which integer? Only arbitrary-size integers (Python lon
On 7/28/2010 8:26 AM, Mark Bakker wrote:
> I don't understand why ceil and floor return real values
The same for ``round``.
(Note that Python 3 rounds to int.)
Furthermore, it would be nice if each took a ``dtype`` argument.
Alan Isaac
___
NumPy-Discus
On Wed, Jul 28, 2010 at 2:26 PM, Mark Bakker wrote:
> Hello list,
>
> I don't understand why ceil and floor return real values, while the doc
> string says:
>
> The ceil of the scalar `x` is the smallest integer `i`
>
> Wouldn't an integer make more sense?
>
> Numpy version 1.3.0.
>
> Thanks,
>
Hi
Wed, 28 Jul 2010 08:43:25 -0400, wheres pythonmonks wrote:
[clip]
> Is there a best solution? I don't like the matplotlib solution b/c of
> the "dll-hell" anti-pattern. But the pure numpy solution looks like it
> has too many copies.
You cannot avoid making copies, since adding a new field chang
I have a rec array and I want to add an additional column.
I've seen at least two solutions to this problem:
mlab.rec_append_fields (matplotlib)
And append_field from
http://mail.scipy.org/pipermail/numpy-discussion/2007-September/029357.html
In [19]: def append_field(rec, name, arr, dtype=None
Hello list,
I don't understand why ceil and floor return real values, while the doc
string says:
The ceil of the scalar `x` is the smallest integer `i`
Wouldn't an integer make more sense?
Numpy version 1.3.0.
Thanks,
Mark
___
NumPy-Discussion maili
On 07/28/2010 05:45 PM, Pauli Virtanen wrote:
> Wed, 28 Jul 2010 12:17:27 +0900, David Cournapeau wrote:
> [clip]
> http://github.com/numpy/numpy_svn
>>
>> I put a new repostory (same location)
>
> Some more notes:
>
> - 1.1.x branch is missing.
>
>This is maybe because in SVN something ugl
Wed, 28 Jul 2010 12:17:27 +0900, David Cournapeau wrote:
[clip]
http://github.com/numpy/numpy_svn
>
> I put a new repostory (same location)
Compared this against git-svn produced repository. There are a number of
commits missing from the early history, apparently because numpy trunk
was mo
Wed, 28 Jul 2010 12:17:27 +0900, David Cournapeau wrote:
[clip]
http://github.com/numpy/numpy_svn
>
> I put a new repostory (same location)
Some more notes:
- 1.1.x branch is missing.
This is maybe because in SVN something ugly was done with this branch?
- Something is still funny with
You should be allowed to remove anything in /usr/local without fear to
kill your operation system.
In case you miss python2.5 afterwards, you should be able to just
install it with apt-get install python2.5 at any time - it would go to
/usr/lib + /usr/bin + ... NOT /usr/local.
It is unlikely that
40 matches
Mail list logo