#Each value in a NumPy array has to have the same data type
#NumPy will automatically figure out an appropriate data type when reading in data or converting lists to arrays.
#You can check the data type of a NumPy array using the dtype property.
number = numpy.array([1,2,3,4]) #全都是int
print(number)
print(number.dtype)
num = numpy.array([1.0,2,3,4]) #全都是float
print(num)
print(num.dtype)
numbers = numpy.array([1, 2, 3, '4.0']) #全都是string
print(numbers)
print(numbers.dtype)
________________________
[1 2 3 4]
int64
[1. 2. 3. 4.]
float64
['1' '2' '3' '4.0']
<U21