On 1/23/2010 7:29 PM, Anne Archibald wrote:
> I had in mind accessing the underlying data through views
> that were flat:
>
> In [3]: x = np.random.random((1000,1000))
>
> In [4]: y = np.random.random((1000,1000))
>
> In [5]: xf = x.view()
>
> In [6]: xf.shape = (-1,)
>
> In [7]: yf = y.view()
>
>
On 1/23/2010 6:00 PM, Keith Goodman wrote:
> x = y.view()
Thanks, but I'm not looking for a view.
And I need x to own its data.
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
2010/1/23 Alan G Isaac :
> On 1/23/2010 5:01 PM, Anne Archibald wrote:
>> If both arrays are "C contiguous", or more generally contiguous blocks
>> of memory with the same strided structure, you might get faster
>> copying by flattening them first, so that it can go in a single
>> memcpy().
>
> I m
On Sat, Jan 23, 2010 at 4:00 PM, Keith Goodman wrote:
> On Sat, Jan 23, 2010 at 2:31 PM, Alan G Isaac wrote:
> > On 1/23/2010 5:01 PM, Anne Archibald wrote:
> >> If both arrays are "C contiguous", or more generally contiguous blocks
> >> of memory with the same strided structure, you might get f
On Sat, Jan 23, 2010 at 2:31 PM, Alan G Isaac wrote:
> On 1/23/2010 5:01 PM, Anne Archibald wrote:
>> If both arrays are "C contiguous", or more generally contiguous blocks
>> of memory with the same strided structure, you might get faster
>> copying by flattening them first, so that it can go in
On 1/23/2010 5:01 PM, Anne Archibald wrote:
> If both arrays are "C contiguous", or more generally contiguous blocks
> of memory with the same strided structure, you might get faster
> copying by flattening them first, so that it can go in a single
> memcpy().
I may misuderstand this. Did you jus
2010/1/23 Alan G Isaac :
> Suppose x and y are conformable 2d arrays.
> I now want x to become a duplicate of y.
> I could create a new array:
> x = y.copy()
> or I could assign the values of y to x:
> x[:,:] = y
>
> As expected the latter is faster (no array creation).
> Are there better ways?
If
As I understand it, numpy.random provides the function ``random`` as an
alias for ``random_state``. Might this be moved into
numpy.random.mtrand.RandomState, for interface consistency?
Right now if I start with ``prng = np.random.RandomState(seed=myseed)``
I cannot use ``prng.random`` as it does
Suppose x and y are conformable 2d arrays.
I now want x to become a duplicate of y.
I could create a new array:
x = y.copy()
or I could assign the values of y to x:
x[:,:] = y
As expected the latter is faster (no array creation).
Are there better ways?
Thanks,
Alan Isaac
_
On Sat, Jan 23, 2010 at 1:53 PM, Christopher Barker
wrote:
> a...@ajackson.org wrote:
>> it doesn't support the reasonable
>> (IMHO) behavior of treating quote delimited strings in the input file as a
>> single field.
>
> I'd use the csv module for that.
>
> Which makes me wonder if it might make
a...@ajackson.org wrote:
> it doesn't support the reasonable
> (IMHO) behavior of treating quote delimited strings in the input file as a
> single field.
I'd use the csv module for that.
Which makes me wonder if it might make sense to build some of the numpy
table-reading stuff on top of it...
>On Mon, Jan 4, 2010 at 10:39 PM, wrote:
>>>Hi folks,
>>>
>>>I'm taking a look once again at fromfile() for reading text files. I
>>>often have the need to read a LOT of numbers form a text file, and it
>>>can actually be pretty darn slow do i the normal python way:
>>>
.big s
12 matches
Mail list logo