Tmiskiewicz
Tmiskiewicz

Reputation: 403

Numpy array into list

I have a numpy array that looks like below:

x = ['11BIT' '4FUNMEDIA' 'ABCDATA' 'ABPL' 'ACAUTOGAZ' 'ADIUVO']

The output should be like this:

x = ['11BIT', '4FUNMEDIA', 'ABCDATA', 'ABPL', 'ACAUTOGAZ', 'ADIUVO']

I tried to use x.tolist() but it didn't help. Basically I need a coma between values. Anyone could help ?

Thanks All

Upvotes: 0

Views: 45

Answers (1)

Schalton
Schalton

Reputation: 3104

"A comma between values" as in a string?

",".join(x)

if you want a true list:

x = list(x)

or

x = [i for i in x]

should do the trick

Upvotes: 3

Related Questions