# 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?

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

Use Python set and then convert to numpy
array?

Pablo Romero <romero619@…32…>
18/03/2009 01:50 PM

To

<matplotlib-users@…1739…ge.net>
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?

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® Flex® framework and Flex Builder™ are

powering Web 2.0 with engaging, cross-platform capabilities. Quickly and

easily build your RIAs with Flex Builder, the Eclipse™based development

software that enables intelligent coding and step-through debugging.

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

This email has been scanned by the MessageLabs Email Security System.