(1)DataFrame(np.random.randn(4,4),index=list('ABCD'),columns=list('EFGH'))
第一个参数===数据 第二个参数==行名(索引) 第三个参数==列名
DataFrame 表格型数据结果。
![](https://img.haomeiwen.com/i11797539/ef540622f043aece.png)
(2)value_counts()是一种查看表格某列中有多少个不同值的快捷方法,并计算每个不同值有在该列中有多少重复值。
value_counts()是Series拥有的方法,一般在DataFrame中使用时,需要指定对哪一列或行使用
(3)Series
Series 类似一维数组对象,左边索引,右边值。
![](https://img.haomeiwen.com/i11797539/dcb6a16aaada28e5.png)
![](https://img.haomeiwen.com/i11797539/36ab146b12201304.png)
![](https://img.haomeiwen.com/i11797539/a5eae80671ac8b13.png)
![](https://img.haomeiwen.com/i11797539/6d8a0f39cb41db4f.png)
函数应用和映射
![](https://img.haomeiwen.com/i11797539/d5fed40180f7fc8b.png)
![](https://img.haomeiwen.com/i11797539/3fbe39ff343473ca.png)
![](https://img.haomeiwen.com/i11797539/ccf8b660189a6cf4.png)
![](https://img.haomeiwen.com/i11797539/b17a499b8fe70582.png)
![](https://img.haomeiwen.com/i11797539/f816414637d5dd0b.png)
![](https://img.haomeiwen.com/i11797539/6e73f85c23603bbf.png)
![](https://img.haomeiwen.com/i11797539/dc542cd81b60eb1a.png)
![](https://img.haomeiwen.com/i11797539/b948518995d97f25.png)
网友评论