> -Original Message-
> From: Christian Gollwitzer
> Sent: Thursday, November 26, 2020 3:26 AM
> To: python-list@python.org
> Subject: Re: Why can't numpy array be restored to saved value?
>
> Am 25.11.20 um 07:47 schrieb pjfarl...@earthlink.net:
> > Why is
> -Original Message-
> From: Greg Ewing
> Sent: Thursday, November 26, 2020 12:01 AM
> To: python-list@python.org
> Subject: Re: Why can't numpy array be restored to saved value?
>
> On 25/11/20 7:47 pm, pjfarl...@earthlink.net wrote:
> > Why isn'
Am 25.11.20 um 07:47 schrieb pjfarl...@earthlink.net:
Why isn't the final value of the numpy array npary in the following code the
same as the initial value before some but not all elements of the array were
changed to a new value?
I know I am missing something basic here. I thou
On 25/11/20 7:47 pm, pjfarl...@earthlink.net wrote:
Why isn't the final value of the numpy array npary in the following code the
same as the initial value before some but not all elements of the array were
changed to a new value?
Slicing a numpy array doesn't copy anything, it just
py ---
> -Original Message-
> From: pjfarl...@earthlink.net
> Sent: Wednesday, November 25, 2020 1:48 AM
> To: 'python-list@python.org'
> Subject: Why can't numpy array be restored to saved value?
>
> Why isn't the final value of the numpy array
Why isn't the final value of the numpy array npary in the following code the
same as the initial value before some but not all elements of the array were
changed to a new value?
I know I am missing something basic here. I thought I understood the
concepts of immutable vs mutable value
jagmit sandhu wrote:
> python newbie. I can't understand the following about numpy arrays:
>
> x = np.array([[0, 1],[2,3],[4,5],[6,7]])
> x
> array([[0, 1],
>[2, 3],
>[4, 5],
>[6, 7]])
> x.shape
> (4, 2)
> y = x[:,0]
> y
> array([0, 2, 4, 6])
> y.shape
> (4,)
>
> Why is t
Il giorno giovedì 2 aprile 2020 06:30:22 UTC+2, jagmit sandhu ha scritto:
> python newbie. I can't understand the following about numpy arrays:
>
> x = np.array([[0, 1],[2,3],[4,5],[6,7]])
> x
> array([[0, 1],
>[2, 3],
>[4, 5],
>[6, 7]])
> x.shape
> (4, 2)
> y = x[:,0]
> y
python newbie. I can't understand the following about numpy arrays:
x = np.array([[0, 1],[2,3],[4,5],[6,7]])
x
array([[0, 1],
[2, 3],
[4, 5],
[6, 7]])
x.shape
(4, 2)
y = x[:,0]
y
array([0, 2, 4, 6])
y.shape
(4,)
Why is the shape for y reported as (4,) ? I expected it to be a
Sharan Basappa writes:
> On Sunday, 8 September 2019 11:16:52 UTC-4, Luciano Ramalho wrote:
>> >>> int('C0FFEE', 16)
>> 12648430
>>
>> There you go!
>>
>> On Sun, Sep 8, 2019 at 12:02 PM Sharan Basappa
>> wrote:
>> >
On Sunday, 8 September 2019 11:16:52 UTC-4, Luciano Ramalho wrote:
> >>> int('C0FFEE', 16)
> 12648430
>
> There you go!
>
> On Sun, Sep 8, 2019 at 12:02 PM Sharan Basappa
> wrote:
> >
> > I have a numpy array that has data in the form o
>>> int('C0FFEE', 16)
12648430
There you go!
On Sun, Sep 8, 2019 at 12:02 PM Sharan Basappa wrote:
>
> I have a numpy array that has data in the form of hex.
> I would like to convert that into decimal/integer.
> Need suggestions please.
> --
> https://ma
I have a numpy array that has data in the form of hex.
I would like to convert that into decimal/integer.
Need suggestions please.
--
https://mail.python.org/mailman/listinfo/python-list
On 05/18/2018 09:50 PM, Sharan Basappa wrote:
This is regarding numpy array. I am a bit confused how parts of the array are
being accessed in the example below.
1 import scipy as sp
2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t")
3 print(data[:10])
4 x = data
The "indexing" page of the documentation might help you with this:
https://docs.scipy.org/doc/numpy-1.14.0/reference/arrays.indexing.html
On 05/18/2018 09:50 PM, sharan.basa...@gmail.com wrote:
This is regarding numpy array. I am a bit confused how parts of the array are
being a
This is regarding numpy array. I am a bit confused how parts of the array are
being accessed in the example below.
1 import scipy as sp
2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t")
3 print(data[:10])
4 x = data[:,0]
5 y = data[:,1]
Apparently, line 3 prints the
Am 30.06.16 um 17:49 schrieb Heli:
Dear all,
After a few tests, I think I will need to correct a bit my question. I will
give an example here.
I have file 1 with 250 lines:
X1,Y1,Z1
X2,Y2,Z2
Then I have file 2 with 3M lines:
X1,Y1,Z1,value11,value12, value13,
X2,Y2,Z2,value21,value22
Dear all,
After a few tests, I think I will need to correct a bit my question. I will
give an example here.
I have file 1 with 250 lines:
X1,Y1,Z1
X2,Y2,Z2
Then I have file 2 with 3M lines:
X1,Y1,Z1,value11,value12, value13,
X2,Y2,Z2,value21,value22, value23,...
I will need to
On Tue, Jun 28, 2016 at 8:45 AM, Heli wrote:
> Hi,
>
> I need to read a file in to a 2d numpy array containing many number of lines.
> I was wondering what is the fastest way to do this?
>
> Is even reading the file in to numpy array the best method or there are
&
On Tue, Jun 28, 2016 at 10:08 AM Hedieh Ebrahimi wrote:
> File 1 has :
> x1,y1,z1
> x2,y2,z2
>
>
> and file2 has :
> x1,y1,z1,value1
> x2,y2,z2,value2
> x3,y3,z3,value3
> ...
>
> I need to read the coordinates from file 1 and then interpolate a value
> for these coordinates on file 2 to the
On Tue, Jun 28, 2016 at 9:51 AM Heli wrote:
> Is even reading the file in to numpy array the best method or there are
> better approaches?
>
What are you trying to accomplish?
Summary statistics, data transformation, analysis...?
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I need to read a file in to a 2d numpy array containing many number of lines.
I was wondering what is the fastest way to do this?
Is even reading the file in to numpy array the best method or there are better
approaches?
Thanks for your suggestions,
--
https://mail.python.org/mailman
On 10 March 2016 at 13:02, Peter Otten <__pete...@web.de> wrote:
> Heli wrote:
>
>> I need to loop over a numpy array and then do the following search. The
>> following is taking almost 60(s) for an array (npArray1 and npArray2 in
>> the example below) with around 3
_id: @eightnoteight
On Mar 10, 2016 5:15 PM, "Heli" wrote:
Dear all,
I need to loop over a numpy array and then do the following search. The
following is taking almost 60(s) for an array (npArray1 and npArray2 in the
example below) with around 300K values.
for id in np.nditer(npArr
> From: sjeik_ap...@hotmail.com
> To: heml...@gmail.com; python-list@python.org
> Subject: RE: looping and searching in numpy array
> Date: Sun, 13 Mar 2016 13:51:23 +
>
> Hi, I suppose you have seen this already (in particular the first link):
> http://nump
> Date: Thu, 10 Mar 2016 08:48:48 -0800
> Subject: Re: looping and searching in numpy array
> From: heml...@gmail.com
> To: python-list@python.org
>
> On Thursday, March 10, 2016 at 2:02:57 PM UTC+1, Peter Otten wrote:
> > Heli wrote:
> >
> > > Dear
On Thursday, March 10, 2016 at 5:49:07 PM UTC+1, Heli wrote:
> On Thursday, March 10, 2016 at 2:02:57 PM UTC+1, Peter Otten wrote:
> > Heli wrote:
> >
> > > Dear all,
> > >
> > > I need to loop over a numpy array and then do the following search. The
>
On Thursday, March 10, 2016 at 2:02:57 PM UTC+1, Peter Otten wrote:
> Heli wrote:
>
> > Dear all,
> >
> > I need to loop over a numpy array and then do the following search. The
> > following is taking almost 60(s) for an array (npArray1 and npArray2 in
> >
On 10/03/2016 11:43, Heli wrote:
Dear all,
I need to loop over a numpy array and then do the following search. The
following is taking almost 60(s) for an array (npArray1 and npArray2 in the
example below) with around 300K values.
for id in np.nditer(npArray1):
newId=(np.where
Heli wrote:
> Dear all,
>
> I need to loop over a numpy array and then do the following search. The
> following is taking almost 60(s) for an array (npArray1 and npArray2 in
> the example below) with around 300K values.
>
>
> for id in np.nditer(npArray1):
>
Dear all,
I need to loop over a numpy array and then do the following search. The
following is taking almost 60(s) for an array (npArray1 and npArray2 in the
example below) with around 300K values.
for id in np.nditer(npArray1):
newId=(np.where(npArray2==id))[0][0
On 9 Dec 2015 14:26, "Heli" wrote:
>
> Dear all,
>
> I am reading a dataset from a HDF5 file using h5py. my datasets are 3D.
>
> Then I will need to check if another 3d numpy array is a subset of this
3D array i am reading from the file.
>
> In general, is ther
Dear all,
I am reading a dataset from a HDF5 file using h5py. my datasets are 3D.
Then I will need to check if another 3d numpy array is a subset of this 3D
array i am reading from the file.
In general, is there any way to check if two 3d numpy arrays have intersections
and if so, get the
On Mon, 6 Jul 2015 at 22:36 Agustin Cruz wrote:
> I'm working on a Python - Raspberry Pi project in which I need to take
> about 30 images per second (no movie) and stack each 2D image to a 3D array
> using numpy array, without saving each 2D capture as a file (because is
> s
a 3D array using numpy
array, without saving each 2D capture as a file (because is slow).
I found this Python code to take images as fast as possible, but i don't know
how to stack all images fast to a 3D stack of images.
import io
import time
import picamera
#from PIL import Image
d
On Monday, July 6, 2015 at 6:00:42 PM UTC-4, Mark Lawrence wrote:
> On 06/07/2015 22:31, Agustin Cruz wrote:
> > I'm working on a Python - Raspberry Pi project in which I need to take
> > about 30 images per second (no movie) and stack each 2D image to a 3D array
> >
On 06/07/2015 22:31, Agustin Cruz wrote:
I'm working on a Python - Raspberry Pi project in which I need to take about 30
images per second (no movie) and stack each 2D image to a 3D array using numpy
array, without saving each 2D capture as a file (because is slow).
I found this Python
I'm working on a Python - Raspberry Pi project in which I need to take about 30
images per second (no movie) and stack each 2D image to a 3D array using numpy
array, without saving each 2D capture as a file (because is slow).
I found this Python code to take images as fast as possible,
>> I think that you want
>>
>> P * R[;,None]
>
> Sorry, I meant
>
> P * R[:, None]
>
> Manolo
Muchísimas gracias, Manolo. Eres un genio y me has ayudado mucho. Te debo una.
--
https://mail.python.org/mailman/listinfo/python-list
On 03/20/15 at 02:11pm, Manolo Martínez wrote:
> On 03/20/15 at 01:46pm, Mr. Twister wrote:
>
> > I have two numpy arrays:
[...]
> > Is there a direct, single expression command to get this result?
>
> I think that you want
>
> P * R[;,None]
Sorry, I meant
P * R[:, None]
Manolo
On 03/20/15 at 01:46pm, Mr. Twister wrote:
> I have two numpy arrays:
>
> >>> P
> array([[[ 2, 3],
> [33, 44],
> [22, 11],
> [ 1, 2]]])
> >>> R
> array([0, 1, 2, 3])
>
> the values of these may of course be different. The important fact is that:
>
> >>> P.shape
> (1,
Hi everyone.
Hope you can help me overcome this "noob" issue.
I have two numpy arrays:
>>> P
array([[[ 2, 3],
[33, 44],
[22, 11],
[ 1, 2]]])
>>> R
array([0, 1, 2, 3])
the values of these may of course be different. The important fact is that:
>>> P.shape
(1, 4, 2)
>>>
On Sat, Oct 18, 2014 at 4:10 PM, Chris Angelico wrote:
> On Sat, Oct 18, 2014 at 6:02 PM, Artur Bercik wrote:
> > So, the Bit No. 2-5 for the following case is '1101', right?
> >
> > 1073741877: 1110101
> >
> > If my required bit combination for Bit No. 2-5 is '1011', t
So, the Bit No. 2-5 for the following case is '1101', right?
1073741877: 1110101
If my required bit combination for Bit No. 2-5 is '1011', then the above
number (1073741877) is not chosen, right??
Look forward to know your confirmation.
On Sat, Oct 18, 2014 at 3:50 PM,
Thanks Chris Angelico for your nice answer.
I got some sense, but could not imagine if required Bit No. 2–5, and Bit
Combination .
I hope example with the new case would make me more sense.
Artur
On Sat, Oct 18, 2014 at 3:24 PM, Chris Angelico wrote:
> On Sat, Oct 18, 2014 at 4:58 PM, A
On Sat, Oct 18, 2014 at 6:21 PM, Artur Bercik wrote:
> Thank you very much Chris Angelico, I have come to know it.
>
You're most welcome. And thank you for taking heed of the request to
not top-post. :) Hang around, you never know what weird and wonderful
things you'll learn!
--
https://mail.pyt
On Sat, Oct 18, 2014 at 6:02 PM, Artur Bercik wrote:
> So, the Bit No. 2-5 for the following case is '1101', right?
>
> 1073741877: 1110101
>
> If my required bit combination for Bit No. 2-5 is '1011', then the above
> number (1073741877) is not chosen, right??
>
> Look f
On Sat, Oct 18, 2014 at 5:42 PM, Artur Bercik wrote:
> I got some sense, but could not imagine if required Bit No. 2–5, and Bit
> Combination .
>
> I hope example with the new case would make me more sense.
>
Just write the number in binary, with the bits you're interested in
set to 1, and e
On Sat, Oct 18, 2014 at 4:58 PM, Artur Bercik wrote:
> I want to get the index of my data where the following occurs:
>
> Bit No. 0–1
> Bit Combination: 00
So, what you want to do is look at each number in binary, and find the
ones that have two zeroes in the last two places?
1073741824: 1000
Dear Python and Numpy Users:
My data are in the form of '32-bit unsigned integer' as follows:
myData = np.array([1073741824, 1073741877, 1073742657, 1073742709,
1073742723, 1073755137, 1073755189,1073755969],dtype=np.int32)
I want to get the index of my data where the following occurs:
Bit No.
On 08/27/2014 08:08 AM, phinn stuart wrote:
Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array
into (480L, 1440L)?
Thanks in the advance.
phinn
A simple assignment into the arrays shape does it:
>>> a = numpy.zeros((1,480,1440))
>>> a.shape
(1, 480,
Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array into
(480L, 1440L)?
Thanks in the advance.
phinn
--
https://mail.python.org/mailman/listinfo/python-list
[source]
<http://github.com/numpy/numpy/blob/v1.8.1/numpy/core/fromnumeric.py#L1072>
<http://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html#numpy.squeeze>
2014-08-27 16:08 GMT+01:00 phinn stuart :
> Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy arr
Thank you very much!
--
https://mail.python.org/mailman/listinfo/python-list
LJ wrote:
> Thank you for the reply.
>
> So, as long as I access and modify the elements of, for example,
>
> A=array([[set([])]*4]*3)
>
>
> as (for example):
>
> a[0][1] = a[0][1] | set([1,2])
>
> or:
>
> a[0][1]=set([1,2])
>
> then I should have no problems?
As long as you set (i. e. re
Thank you for the reply.
So, as long as I access and modify the elements of, for example,
A=array([[set([])]*4]*3)
as (for example):
a[0][1] = a[0][1] | set([1,2])
or:
a[0][1]=set([1,2])
then I should have no problems?
--
https://mail.python.org/mailman/listinfo/python-list
ike your original set) a modification of the
value shows in all six entries. Likewise if you change the `inner` list the
modification shows in all three rows.
>>>> A
> [[0, 0], [0, 0], [0, 0]]
>>>> A[0][0] = 5
>>>> A
> [[5, 0], [5, 0], [5, 0]]
>
> Now,
Wolfgang, thank you very much for your reply.
Following the example in the link, the problem appears:
>>> A = [[0]*2]*3
>>> A
[[0, 0], [0, 0], [0, 0]]
>>> A[0][0] = 5
>>> A
[[5, 0], [5, 0], [5, 0]]
Now, if I use a numpy array:
>>> d=array
On 25.05.2014 00:14, Robert Kern wrote:
On 2014-05-24 23:05, Luis José Novoa wrote:
Hi All,
Hope you're doing great. One quick question. I am defining an array of
sets using numpy as:
a=array([set([])]*3)
Has nothing to do with numpy, but the problem is exclusively with your
innermost expr
On 2014-05-24 23:05, Luis José Novoa wrote:
Hi All,
Hope you're doing great. One quick question. I am defining an array of sets
using numpy as:
a=array([set([])]*3)
Now, if I want to add an element to the set in, lets say, a[0], and I use the
.add(4) operation, which results in:
array([set(
Hi All,
Hope you're doing great. One quick question. I am defining an array of sets
using numpy as:
a=array([set([])]*3)
Now, if I want to add an element to the set in, lets say, a[0], and I use the
.add(4) operation, which results in:
array([set([4]), set([4]), set([4])], dtype=object)
whi
Maybe something like this?
>>> to_num = lambda array: np.sum(array * 2**np.arange(len(array)-1, -1,
-1))
>>> to_num(np.array([1,0,1,0]))
10
2014-04-29 17:42 GMT+02:00 Tom P :
> On 28.04.2014 15:04, mboyd02...@gmail.com wrote:
>
>> I have a numpy array
On 28.04.2014 15:04, mboyd02...@gmail.com wrote:
I have a numpy array consisting of 1s and zeros for representing binary numbers:
e.g.
>>> binary
array([ 1., 0., 1., 0.])
I wish the array to be in the form 1010, so it can be manipulated.
I do not want to use built
mboyd02...@gmail.com Wrote in message:
> I have a numpy array consisting of 1s and zeros for representing binary
> numbers:
>
> e.g.
>
> >>> binary
> array([ 1., 0., 1., 0.])
>
> I wish the array to be in the form 1010, so it can be manipulated
On Mon, 28 Apr 2014 06:04:02 -0700, mboyd02255 wrote:
> I have a numpy array consisting of 1s and zeros for representing binary
> numbers:
>
> e.g.
>
> >>> binary
> array([ 1., 0., 1., 0.])
>
> I wish the array to be in the form 1010, so it ca
I have a numpy array consisting of 1s and zeros for representing binary numbers:
e.g.
>>> binary
array([ 1., 0., 1., 0.])
I wish the array to be in the form 1010, so it can be manipulated.
I do not want to use built in binary converters as I am trying to build my own.
On 1/29/2013 1:49 PM, Alok Singhal wrote:
On Tue, 29 Jan 2013 00:41:54 -0800, C. Ng wrote:
Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
Thanks in advance.
How about:
import numpy as np
a = np.array([[1,2],[3,4]])
a
array([[1, 2], [3, 4]])
On Tue, 29 Jan 2013 00:41:54 -0800, C. Ng wrote:
> Is there a numpy operation that does the following to the array?
>
> 1 2 ==> 4 3
> 3 4 2 1
>
> Thanks in advance.
How about:
>>> import numpy as np
>>> a = np.array([[1,2],[3,4]])
>>> a
array([[1, 2],
[3, 4]])
>>> a[::-1, ::-1]
On Tuesday, January 29, 2013 3:41:54 AM UTC-5, C. Ng wrote:
> Is there a numpy operation that does the following to the array?
>
>
>
> 1 2 ==> 4 3
>
> 3 4 2 1
>
>
>
> Thanks in advance.
>>> import numpy as np
>>> a=np.array([[1,2],[3,4]])
>>> a
array([[1, 2],
[3, 4]])
>>> np.
C. Ng wrote:
> Is there a numpy operation that does the following to the array?
>
> 1 2 ==> 4 3
> 3 4 2 1
How about
>>> a
array([[1, 2],
[3, 4]])
>>> a[::-1].transpose()[::-1].transpose()
array([[4, 3],
[2, 1]])
Or did you mean
>>> a.reshape((4,))[::-1].reshape((2,2))
ar
Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
On 18/09/12 16:02:02, Wanderer wrote:
> On Monday, September 17, 2012 7:43:06 PM UTC-4, Martin De Kauwe wrote:
>> On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote:
>>> I need to divide a 512x512 image array with the first horizontal
>>> and vertical division 49 pixels in. Then every
On Monday, September 17, 2012 7:43:06 PM UTC-4, Martin De Kauwe wrote:
> On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote:
>
> > I need to divide a 512x512 image array with the first horizontal and
> > vertical division 49 pixels in. Then every 59 pixels in after that. hsplit
> >
On 17 September 2012 23:31, Wanderer wrote:
> I need to divide a 512x512 image array with the first horizontal and
> vertical division 49 pixels in. Then every 59 pixels in after that. hsplit
> and vsplit want to start at the edges and create a bunch of same size
> arrays. Is there a command to c
On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote:
> I need to divide a 512x512 image array with the first horizontal and vertical
> division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit
> want to start at the edges and create a bunch of same size arrays. Is
I need to divide a 512x512 image array with the first horizontal and vertical
division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit
want to start at the edges and create a bunch of same size arrays. Is there a
command to chop off different sized arrays?
Thanks
--
http://
On Mar 24, 3:14 pm, Wanderer wrote:
> I'm using ctypes to have a dll fill a buffer with 16 bit data. I then
> want to convert this data to a numpy array. The code snippet below
> converts the data from 16 bit to 32 bit, but two 16 bit numbers are
> concatenated to make a 32 bi
I'm using ctypes to have a dll fill a buffer with 16 bit data. I then
want to convert this data to a numpy array. The code snippet below
converts the data from 16 bit to 32 bit, but two 16 bit numbers are
concatenated to make a 32 bit number and half the array is zero.
Buffer = (c_
Nobody wrote:
> On Mon, 22 Nov 2010 11:37:22 +0100, Peter Otten wrote:
>
>>> is there a convenient way to read bz2 files into a numpy array?
>>
>> Try
>
>> f = bz2.BZ2File(filename)
>> data = numpy.fromstring(f.read(), numpy.float32)
>
> That
On Mon, 22 Nov 2010 11:37:22 +0100, Peter Otten wrote:
>> is there a convenient way to read bz2 files into a numpy array?
>
> Try
> f = bz2.BZ2File(filename)
> data = numpy.fromstring(f.read(), numpy.float32)
That's going to hurt if the file is large.
You might be bette
Johannes Korn wrote:
> I tried:
>
> from bz2 import *
> from numpy import *
> fd = BZ2File(filename, 'rb')
> read_data = fromfile(fd, float32)
>
> but BZ2File doesn't seem to produce a transparent filehandle.
> is there a convenient way to read bz2 fi
Hi,
is there a convenient way to read bz2 files into a numpy array?
I tried:
from bz2 import *
from numpy import *
fd = BZ2File(filename, 'rb')
read_data = fromfile(fd, float32)
but BZ2File doesn't seem to produce a transparent filehandle.
Kind regards!
Johannes
--
http://
On 2009-10-08 15:14 PM, Felix wrote:
I am trying to create a shared, read-only numpy.ndarray between
several processes. After some googling the basic idea is:
sarr = mp.Array('i',1000)
ndarr = scipy.frombuffer(sarr._obj,dtype='int32')
Since it will be read only (after being filled once in a si
Hi,
The documentation for the Multiprocessing.Array says:
multiprocessing.Array(typecode_or_type, size_or_initializer, *,
lock=True)¶
...
If lock is False then access to the returned object will not be
automatically protected by a lock, so it will not necessarily be
“process-safe”.
...
However:
On 2009-08-10 17:38, Nathan wrote:
Is there an easy way to merge two numpy arrays with different rank
sizes (terminology?).
You will want to ask numpy questions on the numpy mailing list.
http://www.scipy.org/Mailing_Lists
I believe that "shape" is the term you are looking for.
I want to
Is there an easy way to merge two numpy arrays with different rank
sizes (terminology?). I want to make a single array by concatenating
two arrays along a given direction and filling the excess cells with a
dummy variable. numpy concatenate works well as long as the two
arrays have the same dimen
On 2009-07-24 18:26, greg wrote:
Robert Kern wrote:
a[:0] = array('i', [0])
Not when 'a' is a numpy array rather than an array.array.
That's true, but I got the impression that the OP was
talking about array.array, not numpy.array.
Did you read the Subject: line
Robert Kern wrote:
a[:0] = array('i', [0])
Not when 'a' is a numpy array rather than an array.array.
That's true, but I got the impression that the OP was
talking about array.array, not numpy.array.
It's very confusing having two widely-used types
both called
On 2009-07-22 01:51, greg wrote:
bdb112 wrote:
I saw this interest syntax on this site
x[:0]=0
I guess that is cute, but could be confusing(and doesn't work)
It does if you use an array of the appropriate
type on the right hand side:
a[:0] = array('i', [0])
Not when
bdb112 wrote:
I saw this interest syntax on this site
x[:0]=0
I guess that is cute, but could be confusing(and doesn't work)
It does if you use an array of the appropriate
type on the right hand side:
a[:0] = array('i', [0])
--
Greg
--
http://mail.python.org/mailman/listinfo/python-li
On 2009-07-20 22:56, bdb112 wrote:
If I want to add an element at the beginning of an array, it seems
like I must make a list, insert in place, then make an array again.
the_array = numpy.concatenate([new_value, the_array])
You will want to ask numpy questions on the numpy mailing list.
htt
On Jul 21, 2:13 pm, Ben Finney wrote:
> bdb112 writes:
> > If I want to add an element at the beginning of an array, it seems
> > like I must make a list, insert in place, then make an array again.
>
> The NumPy ‘ndarray’ type (which is what you get by default from the
> ‘array’ factory function)
bdb112 writes:
> If I want to add an element at the beginning of an array, it seems
> like I must make a list, insert in place, then make an array again.
The NumPy ‘ndarray’ type (which is what you get by default from the
‘array’ factory function) is a far more complex type than (and is not
deri
If I want to add an element at the beginning of an array, it seems
like I must make a list, insert in place, then make an array again.
Of course, lists can be efficient too, and the insert() funtion works
nicely in that case, but sometimes arrays are the best choice
e.g.
x=array([1,2,3])
# to put
On 2009-07-02 04:40, Sebastian Schabe wrote:
Robert Kern schrieb:
> You will want to ask numpy questions on the numpy mailing list.
>
> http://www.scipy.org/Mailing_Lists
>
I ever thought news-groups are the right way for questions like this.
And the mailing list page just confuses me, bu
Robert Kern schrieb:
First, convert the pos array to integers, and just the columns with
indices in them:
ipos = pos[:,:2].astype(int)
Now check the values in the mask corresponding to these positions:
mask_values = mask[ipos[:,0], ipos[:,1]]
Now extract the rows from the original pos ar
On 2009-07-01 09:51, Sebastian Schabe wrote:
Hello everybody,
I'm new to python and numpy and have a little/special problem:
You will want to ask numpy questions on the numpy mailing list.
http://www.scipy.org/Mailing_Lists
I have an numpy array which is in fact a gray scale image
Sebastian Schabe writes:
> I want to avoid a for loop (if possible!!!) cause I think (but don't
> know) numpy array are handled in another way.
Yes, Numpy arrays can be indexed logically by a boolean array.
> I think numpy.delete is the right function for discarding the values,
Hello everybody,
I'm new to python and numpy and have a little/special problem:
I have an numpy array which is in fact a gray scale image mask, e.g.:
mask =
array([[ 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0
>> Is there any reason the 'axis' keyword argument doesn't default to the
>> value that corresponds to python list behaviour? That would make lot
>> of sense I think. Or retaining compatibility with python lists is not
>> really a goal of numpy.array?
>
> Not at all. It's an entirely different data
1 - 100 of 156 matches
Mail list logo