4
Answers

why only first character in array?

Photo of Valerie Meunier

Valerie Meunier

2y
877
1

Hi

this code puts only the first character in the third element of the array. How come and how to solve this?

Thanks. V.

import numpy as np
arr = np.array(["","",""])
arr[2]="abcde"
print(arr[2]) # show only 'a'
 

Answers (4)