软件包概述

pandas是一个开源的BSD许可库,为Python编程语言提供高性能,易用的数据结构和数据分析工具。

pandas由以下元素组成

  • 一组标记的数组数据结构,其中主要是Series和DataFrame
  • 支持简单轴索引和多级/分层轴索引的索引对象
  • 用于聚合和转换数据集的引擎集合
  • 日期范围生成(date_range)和自定义日期偏移量以实现自定义日期频率
  • 输入/输出工具:从扁平文件(CSV,分隔,Excel 2003)中加载表格数据,以及从快速高效的PyTables / HDF5格式保存和加载pandas对象。
  • 标准数据结构的内存高效“稀疏”版本,用于存储大部分缺失或大部分为常量的数据(某些固定值)
  • 移动窗口统计(滚动平均值,滚动标准偏差等)

数据结构

维度 名称 描述
1 Series 一维有标记的单一数据类型数组
2 DataFrame 一般为二维有标记,可能带有不同数据类型列的大小可变的表格结构

为什么不止一个数据结构?

考虑到pandas数据结构的最优方式是为低维数据提供灵活的容器。 例如,DataFrame是Series的容器,Series是标量的容器。 我们希望能够以字典式的方式插入和移除这些容器中的对象。

另外,我们也要考虑时间序列和横截面数据集的典型方向的通用API函数的合理默认行为。 When using ndarrays to store 2- and 3-dimensional data, a burden is placed on the user to consider the orientation of the data set when writing functions; axes are considered more or less equivalent (except when C- or Fortran-contiguousness matters for performance). In pandas, the axes are intended to lend more semantic meaning to the data; i.e., for a particular data set there is likely to be a “right” way to orient the data. The goal, then, is to reduce the amount of mental effort required to code up data transformations in downstream functions.

For example, with tabular data (DataFrame) it is more semantically helpful to think of the index (the rows) and the columns rather than axis 0 and axis 1. And iterating through the columns of the DataFrame thus results in more readable code:

for col in df.columns:
    series = df[col]
    # do something with series

Mutability and copying of data

所有pandas数据结构都是值可变的(它们包含的值可以改变)但不总是大小可变的。 无法更改Series的长度,但是,例如,可以将列插入到DataFrame中。 但是,绝大多数方法都会生成新对象并保持输入数据不变。 In general, though, we like to favor immutability where sensible.

Getting Support

The first stop for pandas issues and ideas is the Github Issue Tracker. If you have a general question, pandas community experts can answer through Stack Overflow.

Community

pandas is actively supported today by a community of like-minded individuals around the world who contribute their valuable time and energy to help make open source pandas possible. Thanks to all of our contributors.

If you’re interested in contributing, please visit Contributing to pandas webpage.

pandas is a NUMFocus sponsored project. This will help ensure the success of development of pandas as a world-class open-source project, and makes it possible to donate to the project.

Project Governance

The governance process that pandas project has used informally since its inception in 2008 is formalized in Project Governance documents . The documents clarify how decisions are made and how the various elements of our community interact, including the relationship between open source collaborative development and work that may be funded by for-profit or non-profit entities.

Wes McKinney is the Benevolent Dictator for Life (BDFL).

Development Team

The list of the Core Team members and more detailed information can be found on the people’s page of the governance repo.

Institutional Partners

The information about current institutional partners can be found on pandas website page

License

BSD 3-Clause License

Copyright (c) 2008-2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Scroll To Top