Use Python set and then convert to numpy array?

Pablo Romero <>

18/03/2009 01:50 PM

[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).

# lev=(0,2,4,6,8,...,20)


#I want something like...


#WITHOUT repeating elements (i.e., only one '12' in resulting array), i.e., I want:

#or, add just a unique element(s)


#so I would want lev4 to look like this:

are these types of operations possible using numpy?
How can this be done?

Please help


Windows Live™ Contacts: Organize your contact list.!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.
Matplotlib-users mailing list

This email has been scanned by the MessageLabs Email Security System.
For more information please visit

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.