pandas.Series Data Structure

From GM-RKB
Jump to navigation Jump to search

A pandas.Series Data Structure is a Python-based indexed one-dimensional ndarray with labelable index valuels.



References

2014

  • http://pandas.pydata.org/pandas-docs/stable/dsintro.html#series
    • Series is a one-dimensional labeled array capable of holding any data type (integers, strings, floating point numbers, Python objects, etc.). The axis labels are collectively referred to as the index. The basic method to create a Series is to call:
      >>> s = Series(data, index=index) Here, data can be many different things:
      • a Python dict
      • an ndarray
      • a scalar value (like 5)
    • The passed index is a list of axis labels. Thus, this separates into a few cases depending on what data is: ...


  • http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
    • class pandas.Series(data=None, index=None, dtype=None, name=None, copy=False, fastpath=False)
    • One-dimensional ndarray with axis labels (including time series).
    • Labels need not be unique but must be any hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Statistical methods from ndarray have been overridden to automatically exclude missing data (currently represented as NaN)
    • Operations between Series (+, -, /, , *) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes.