pandas.DataFrame Table
Jump to navigation
Jump to search
A pandas.DataFrame Table is a data frame structure that is a Python-based pandas Data Structure.
- Context
- It can (typically) have one or more pandas.DataFrame Column.
- It can support a pandas.DataFrame Attribute.
- It can support a pandas.DataFrame Operation, such as a pandas.DataFrame query, keys(), ...
- It can (typically) be in Python code after an
import pandas as pd
Python statement.
- Example(s):
df = pd.DataFrame({'col1' : Series([1., 2., 3.], index=['row3', 'row2', 'row1']), 'col2' : Series([1., 2., 3., 4.], index=['row1', 'row2', 'row3', 'row4']) })
, with explicit index keys.- a pandas.DataFrame v0.13.1 Table.
- …
- Counter-Example(s)
- See: Python Dictionary.
References
2014
- http://en.wikipedia.org/wiki/Pandas_(software)#Library_highlights
- A fast and efficient DataFrame object for data manipulation with integrated indexing;
- http://pandas.pydata.org/pandas-docs/stable/dsintro.html#dataframe
- DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it like a spreadsheet or SQL table, or a dict of Series objects. It is generally the most commonly used pandas object. Like Series, DataFrame accepts many different kinds of input:
- Dict of 1D ndarrays, lists, dicts, or Series
- 2-D numpy.ndarray.
- Structured or record ndarray
- A
Series
- Another
DataFrame
- Along with the data, you can optionally pass index (row labels) and columns (column labels) arguments. If you pass an index and / or columns, you are guaranteeing the index and / or columns of the resulting DataFrame. Thus, a dict of Series plus a specific index will discard all data not matching up to the passed index.
If axis labels are not passed, they will be constructed from the input data based on common sense rules.
- DataFrame is a 2-dimensional labeled data structure with columns of potentially different types. You can think of it like a spreadsheet or SQL table, or a dict of Series objects. It is generally the most commonly used pandas object. Like Series, DataFrame accepts many different kinds of input:
2013
- http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.html
class pandas.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)
- Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. The primary pandas data structure.
- Parameters :
- data : numpy ndarray (structured or homogeneous), dict, or DataFrame
Dict can contain Series, arrays, constants, or list-like objects - index : Index or array-like
Index to use for resulting frame. Will default to np.arange(n) if no indexing information part of input data and no index provided - columns : Index or array-like
Column labels to use for resulting frame. Will default to np.arange(n) if no column labels are provided - dtype : dtype, default None
Data type to force, otherwise infer - copy : boolean, default False
Copy data from inputs. Only affects DataFrame / 2d ndarray input
- data : numpy ndarray (structured or homogeneous), dict, or DataFrame