01pyplot方法列表
模块简介matplotlib.pyplot is a state-based interface to matplotlib. It provides a MATLAB-like way of plotting. 使用教程pyplot is mainly intended for interactive plots and simple cases of programmatic plot generation: 123456import numpy as npimport matplotlib.pyplot as pltx = np.arange(0, 5, 0.1)y = np.sin(x)plt.plot(x, y) 内部函数 名称 作用 acorr(x,*[,data]) Plot the autocorrelation of x. angle_spectrum(x[,Fs,Fc,window,pad_to,…]) Plot the angle spectrum. annotate(text,xy,*args,**kwargs) Annotate ...
axisartist
Overview of axisartist toolkitThe axisartist toolkit tutorial. ::: danger Warning axisartist uses a custom Axes class(derived from the mpl’s original Axes class).As a side effect, some commands (mostly tick-related) do not work. ::: The axisartist contains a custom Axes class that is meant to supportcurvilinear grids (e.g., the world coordinate system in astronomy).Unlike mpl’s original Axes class which uses Axes.xaxis and Axes.yaxisto draw ticks, ticklines, etc., axisartist uses a specialart...
basics
基础用法本节介绍 Pandas 数据结构的基础用法。下列代码创建上一节用过的示例数据对象: 1234567In [1]: index = pd.date_range('1/1/2000', periods=8)In [2]: s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])In [3]: df = pd.DataFrame(np.random.randn(8, 3), index=index, ...: columns=['A', 'B', 'C']) ...: Head 与 Tailhead() 与 tail() 用于快速预览 Series 与 DataFrame,默认显示 5 条数据,也可以指定显示数据的数量。 1234567891011121314151617In [...
10min
十分钟入门 Pandas本节是帮助 Pandas 新手快速上手的简介。烹饪指南里介绍了更多实用案例。 本节以下列方式导入 Pandas 与 NumPy: 123In [1]: import numpy as npIn [2]: import pandas as pd 生成对象详见数据结构简介文档。 用值列表生成 Series 时,Pandas 默认自动生成整数索引: 1234567891011In [3]: s = pd.Series([1, 3, 5, np.nan, 6, 8])In [4]: sOut[4]: 0 1.01 3.02 5.03 NaN4 6.05 8.0dtype: float64 用含日期时间索引与标签的 NumPy 数组生成 DataFrame: 12345678910111213141516171819In [5]: dates = pd.date_range('20130101', periods=6)In [6]: datesOut[6]: DatetimeIndex(['201...
overview
Pandas 概览Pandas 是 Python 的核心数据分析支持库,提供了快速、灵活、明确的数据结构,旨在简单、直观地处理关系型、标记型数据。Pandas 的目标是成为 Python 数据分析实践与实战的必备高级工具,其长远目标是成为最强大、最灵活、可以支持任何语言的开源数据分析工具。经过多年不懈的努力,Pandas 离这个目标已经越来越近了。 Pandas 适用于处理以下类型的数据: 与 SQL 或 Excel 表类似的,含异构列的表格数据; 有序和无序(非固定频率)的时间序列数据; 带行列标签的矩阵数据,包括同构或异构型数据; 任意其它形式的观测、统计数据集, 数据转入 Pandas 数据结构时不必事先标记。 Pandas 的主要数据结构是 Series(一维数据)与 DataFrame(二维数据),这两种数据结构足以处理金融、统计、社会科学、工程等领域里的大多数典型用例。对于 R 用户,DataFrame 提供了比 R 语言 data.frame 更丰富的功能。Pandas 基于 NumPy 开发,可以与其它第三方科学计算支持库完美集成。 Pandas 就像一把万能...
tutorials
教程资料为方便新用户上手 Pandas,本节收录了众多 Pandas 教程。 官方指南十分钟入门 Pandas,Pandas 团队出品。 Cookbook ,Pandas 实用案例。 Pandas 速查表,案头必备。 社区指南《Pandas Cookbook》Julia Evans 著Julia Evans 2015 年编著的《Pandas Cookbook》包含了很多 Pandas 实战例子,这些例子大多基于实战数据,涵盖了绝大多数新手小白遇到的实际问题。代码请参阅 Pandas-cookbook 的 GitHub 仓库。 《Learn Pandas》 Hernan Rojas 著面对新用户介绍 Pandas 学习经验:https://bitbucket.org/hrojas/learn-Pandas Python 数据分析实战该指南介绍了用 Python 数据生态系统对开源数据集进行数据分析的过程。涵盖了数据整理、数据聚合、数据可视化和时间序列。 新手习题用真实数据集与习题,锻炼 Pandas 运用能力。更多资源,请参阅这个仓库。 现代 PandasTom Augspurge...
dsintro
数据结构简介本节介绍 Pandas 基础数据结构,包括各类对象的数据类型、索引、轴标记、对齐等基础操作。首先,导入 NumPy 和 Pandas: 123In [1]: import numpy as npIn [2]: import pandas as pd “数据对齐是内在的”,这一原则是根本。除非显式指定,Pandas 不会断开标签和数据之间的连接。 下文先简单介绍数据结构,然后再分门别类介绍每种功能与方法。 SeriesSeries 是带标签的一维数组,可存储整数、浮点数、字符串、Python 对象等类型的数据。轴标签统称为索引。调用 pd.Series 函数即可创建 Series: 1>>> s = pd.Series(data, index=index) 上述代码中,data 支持以下数据类型: Python 字典 多维数组 标量值(如,5) index 是轴标签列表。不同数据可分为以下几种情况: 多维数组 data 是多维数组时,index 长度必须与 data 长度一致。没有指定 index 参数时,创建数值型索引,即 [0, ..., ...
comparison
与其他工具比较与R/R库的比较由于 pandas 旨在为人们提供可以替代R的大量数据操作和分析的功能,因此本章节会提供较为详细的R语言的介绍以及与相关的许多第三方库的对比说明,比如我们的 pandas 库。在与R和CRAN库的比较中,我们关注以下事项: 功能/灵活性:每个工具可以/不可以做什么 性能:操作速度有多快。硬性数字/基准是优选的 易于使用:一种工具更容易/更难使用(您可能需要对此进行判断,并进行并排代码比较) 此页面还为这些R包的用户提供了一些翻译指南。 要将 DataFrame 对象从 pandas 转化为到 R 的数据类型,有一个选择是采用HDF5文件,请参阅外部兼容性示例。 快速参考我们将从快速参考指南开始,将dplyr与pandas等效的一些常见R操作配对。 查询、过滤、采样 R Pandas dim(df) df.shape head(df) df.head() slice(df, 1:10) df.iloc[:9] filter(df, col1 == 1, ...
advanced
多层级索引和高级索引本章节包含了使用多层级索引 以及 其他高级索引特性。 请参阅 索引与选择数据来获得更多的通用索引方面的帮助文档 ::: danger 警告 基于实际的使用场景不同,返回的内容也会不尽相同(返回一个数据的副本,或者返回数据的引用)。有时,这种情况被称作连锁赋值,但是这种情况应当被尽力避免。参见返回视图or返回副本。 ::: 参见 cookbook,获取更多高级的使用技巧。 分层索引(多层级索引)分层/多级索引在处理复杂的数据分析和数据操作方面为开发者奠定了基础,尤其是在处理高纬度数据处理上。本质上,它使您能够在较低维度的数据结构(如 Series(1d)和DataFrame (2d))中存储和操作任意维数的数据。 在本节中,我们将展示“层次”索引的确切含义,以及它如何与上面和前面部分描述的所有panda索引功能集成。稍后,在讨论分组 和数据透视与重塑性数据时,我们将展示一些重要的应用程序,以说明它如何帮助构建分析数据的结构。 请参阅cookbook,查看一些高级策略. 在0.24.0版本中的改变:MultIndex.labels被更名为MultiIn...
categorical
Categorical dataThis is an introduction to pandas categorical data type, including a short comparisonwith R’s factor. Categoricals are a pandas data type corresponding to categorical variables instatistics. A categorical variable takes on a limited, and usually fixed,number of possible values (categories; levels in R). Examples are gender,social class, blood type, country affiliation, observation time or rating viaLikert scales. In contrast to statistical categorical variables, categorical da...













