Pandas模块中的Series:基础入门
发布时间
阅读量:
阅读量
基本概念界定
Series 是一种具备标签的一维数据结构,能够存储包括整数、字符串、浮点数值以及 Python 对象在内的多种数据类型,其轴标签被统称为索引。
import numpy as np
import pandas as pd
s = pd.Series(np.random.randint(5,size = 5))
print(s)
print(type(s))
================================
0 1
1 1
2 4
3 1
4 4
dtype: int32
AI写代码python
print(s.index,type(s.index))
print(s.values,type(s.values))
# .index查看series索引,类型为rangeindex
# .values查看ser
全部评论 (0)
还没有任何评论哟~
