Python Data Analysis Library
pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.
pandas is a NUMFocus sponsored project. This will help ensure the success of development of pandas as a world-class open-source project.
In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
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 = pd.Series(data, index=index)
From ndarray
In [4]:
s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])
s
Out[4]:
In [5]:
s = pd.Series([1,3,5,np.nan,6,8])
s
Out[5]:
From dict
In [7]:
d = {'a' : 0., 'b' : 1., 'c' : 2.}
pd.Series(d)
Out[7]:
Series is ndarray-like and dict-like
In [ ]: