数组操作
切片和索引
ndarray 对象的内容可以通过索引或切片来访问和修改,与 Python 中 list 的切片操作一样。...a = np.arange(6)
print("原始数组:", a)
b = a.reshape(3, 2)
print("变换后数组:", b)
>>>
原始数组: [0 1 2 3 4 5]
变换后数组...delete 删掉某个轴的子数组,返回删除后的新数组
unique 查找数组内的唯一元素
NumPy 统计运算
计算最大最小值
numpy.amin(),计算数组中延指定轴的最小值
numpy.amax...方差是每个样本值与全体样本值的平均数之差的平方值的平均数。...df = pd.DataFrame({'A': ['foo', 'bar', 'bar', 'foo', 'foo', 'foo'],
'B': ['one', 'two', 'three', 'one