# Series 数据结构 # Series 是带有标签的一维数组,可以保存任何数据类型(整数,字符串,浮点数,Python对象等),轴标签统称为索引 import numpy as np import pandas as pd # 导入numpy.pandas模块 s = pd.Series(np.random.rand()) print(s) print(type(s)) # 查看数据.数据类型 print(s.index,type(s.index)) print(s.values,type
import numpy as np import pandas as pd Pandas will be a major tool of interest throughout(贯穿) much of the rest of the book. It contains data structures and manipulation tools designed to make data cleaning(数据清洗) and analysis fast and easy in Python.
原文 C#中数据类型的安全转换(is,as) 下面代码中,不能装箱,在强制类型转换时出错,因为之前 c 是 class 类型,而却要把它转换为 int 类型,这是不可以的.虽然编译器能通过编译,但是 runtime 在运行时会抛出 InvalidCastException 异常. Circle c = new Circle(8); object o = c; // 本条语句正确,但是不会装箱,因为装箱是从栈到堆,需要的是值类型,而 c 是引用类型 int i = (int)o; // 编译成功