模块基础
import numpy
#创建一维数组
#numpy.array([元素1,元素2])
x=numpy.array(["22","19","9","8"])
#创建二维数组
#numpy.array([[元素1,元素2],[元素1,元素2],[元素1,元素2]])
y=numpy.array([["hdsafg","asjhgf","878392"],["jhyfsdaeku","jhgsda"],["素1","元素2"]])
#排序
x.sort()
#print(x)
'''
注意:
#如果取最大值和最小值,元素必须是数字
#同一维度各个数组之间,长度一样
'''
#会出错#y=numpy.array([["3","10","2"],["9","7"],["5","9"]])
#会出错#y=numpy.array([[3,10,2],[9,17],[5,9]])
y=numpy.array([[3,10,2],[9,17,8],[5,9,1]])
xm=y.max()
#print(xm)
ymin=y.min()
#print(ymin)
#切片
#数组[起始下标:最终下标+1]
x1=x[1:3]
#print(x1)
x2=x[:2]
#print(x2)
x3=x[1:]
#print(x3)
#pandas
import pandas as pda
'''
Series:序列
DataFrame:
'''
a=pda.Series([9,2,8,1])
b=pda.DataFrame([["3","10","2"],["9","7","4"],["5","9","1"]])
#取头部数据,默认前五行
b.head()
b.head(2)
#取尾部数据,默认后五行
b.tail()
b.tail(2)
#显示数据的基本统计信息
b.describe()
#转置
b.T