import numpy as np
import pandas as pd
numpy:一维数组
a=np.array([1,2,3,4,5])
print(a[0])#查询
print(a[1:3])#切片
for i in a:
print(i)#循环访问
print(a.dtype)#数据类型
c=a+1
print(c)#向量化运算
1
[2 3]
1
2
3
4
5
int32
[2 3 4 5 6]
pandas:一维数组
barca=pd.Series([11,10,9,],index=['neymar','messi','suarez'])
print(barca)
neymar 11
messi