## matplotlib-users

 [Matplotlib-users] quick numpy question From: Pablo Romero - 2009-03-18 02:50:51 ```quick numpy-related question. I want to use numpy.arange() to create multiple arrays, and then I want to join these arrays (or individual elements) to the final array without repeating existing elements (create a 'union' from 2 or more arrays or individual elements). example: lev=np.arange(0,20,2) # lev=(0,2,4,6,8,...,20) lev1=np.arange(0,18,3) #lev1=(0,3,6,9,12,15,18) #I want something like... lev3=lev1+lev2 #WITHOUT repeating elements (i.e., only one '12' in resulting array), i.e., I want: #lev3=(0,2,3,4,6,8,9,10,12,14,15,16,18,20) #or, add just a unique element(s) lev4=lev3+(50,60) #so I would want lev4 to look like this: #lev4=(0,2,3,4,6,8,9,10,12,14,15,16,18,20,50,60) are these types of operations possible using numpy? How can this be done? Please help Thanks, P.Romero _________________________________________________________________ Windows Live™ Contacts: Organize your contact list. http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009 ```
 Re: [Matplotlib-users] quick numpy question From: - 2009-03-18 03:28:29 Attachments: Message as HTML ```Use Python set and then convert to numpy array? Pablo Romero 18/03/2009 01:50 PM To cc Subject [Matplotlib-users] quick numpy question quick numpy-related question. I want to use numpy.arange() to create multiple arrays, and then I want to join these arrays (or individual elements) to the final array without repeating existing elements (create a 'union' from 2 or more arrays or individual elements). example: lev=np.arange(0,20,2) # lev=(0,2,4,6,8,...,20) lev1=np.arange(0,18,3) #lev1=(0,3,6,9,12,15,18) #I want something like... lev3=lev1+lev2 #WITHOUT repeating elements (i.e., only one '12' in resulting array), i.e., I want: #lev3=(0,2,3,4,6,8,9,10,12,14,15,16,18,20) #or, add just a unique element(s) lev4=lev3+(50,60) #so I would want lev4 to look like this: #lev4=(0,2,3,4,6,8,9,10,12,14,15,16,18,20,50,60) are these types of operations possible using numpy? How can this be done? Please help Thanks, P.Romero _________________________________________________________________ Windows Live? Contacts: Organize your contact list. http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@... https://lists.sourceforge.net/lists/listinfo/matplotlib-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ UNITED GROUP This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access. If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.```
 Re: [Matplotlib-users] quick numpy question From: Jouni K. Seppänen - 2009-03-18 05:45:04 ```Pablo Romero writes: > quick numpy-related question. Not the best mailing list then, but... > I want to use numpy.arange() to create multiple arrays, and then I > want to join these arrays (or individual elements) to the final array > without repeating existing elements (create a 'union' from 2 or more > arrays or individual elements). Try np.union1d (and note that the numpy book has been in the public domain since August: http://www.tramy.us/guidetoscipy.html ) -- Jouni K. Seppänen http://www.iki.fi/jks ```
 Re: [Matplotlib-users] quick numpy question From: Pablo Romero - 2009-03-18 08:27:21 ```Thank you, and I apologize if the question wasnt appropriate for this list. P.Romero ---------------------------------------- > To: matplotlib-users@... > From: jks@... > Date: Wed, 18 Mar 2009 07:44:33 +0200 > Subject: Re: [Matplotlib-users] quick numpy question > > Pablo Romero writes: > >> quick numpy-related question. > > Not the best mailing list then, but... > >> I want to use numpy.arange() to create multiple arrays, and then I >> want to join these arrays (or individual elements) to the final array >> without repeating existing elements (create a 'union' from 2 or more >> arrays or individual elements). > > Try np.union1d (and note that the numpy book has been in the public > domain since August: http://www.tramy.us/guidetoscipy.html ) > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users _________________________________________________________________ Hotmail® is up to 70% faster. Now good news travels really fast. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009 ```