Reputation: 1345
All,
I have a dataframe which I am using to extract all unique identifiers as follows:
myTradeFrame['coll_cusip'].unique()
the output is:
array(['BRSUJX0F8', 'BRSU17NB8', '010831BE4', ..., '912828J84',
'912828R36', '912810RC4'], dtype=object)
How can I convert that array into something that looks like this:
('BRSUJX0F8', 'BRSU17NB8', '010831BE4', ..., '912828J84',
'912828R36', '912810RC4')
Many Thanks
Upvotes: 0
Views: 81
Reputation: 48337
Since myTradeFrame['coll_cusip'].unique()
returns a numpy array, use tuple
method.
array = myTradeFrame['coll_cusip'].unique()
list = tuple(array)
Upvotes: 2
Reputation: 10476
To get it to return something in the form you asked for (which isn't a list but a tuple), you should use tuple
:
tuple(myTradeFrame['coll_cusip'].unique())
Upvotes: 3