1.学习目标
2.重要知识点
3.拓展练习题
本大纲版权,归科赛网所有
学习目标
- 掌握 pandas Series 的创建和使用
- 掌握 pandas DataFrame 的创建和使用
重要知识点
-
pandas的三个核心数据结构为:Series,DataFrame,和Index。
A Pandas Series is a one-dimensional array of indexed data DataFrame is an analog of a two-dimensional array with both flexible row indices and flexible column names.
-
pandas Series 的创建和使用
可以看做 dict,带坐标轴的一维 numpy array
可以通过 list, dict 等方式创建
详见:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
-
pandas DataFrame 的创建和使用
二维表格型数据结构,可以看作是 Series 对象的 dict 容器
可以通过 a list of dicts, a dict of lists, numpy array 等方式创建
此外,DataFrame 还有各种类似数据库的操作,如合并、聚合和分组等
详见:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html
-
Pandas 和 DataFrame 的关系
If a Series is an analog of a one-dimensional array with flexible indices, a DataFrame is an analog of a two dimensional array with both flexible row indices and flexible column names. Just as you might think of a two-dimensional array as an ordered sequence of aligned one-dimensional columns, you can think of a DataFrame as a sequence of aligned Series objects. Here, by "aligned" we mean that they share the same index.
-
视频内容参考链接:https://jakevdp.github.io/PythonDataScienceHandbook/03.01-introducing-pandas-objects.html