NumPy #
We can use NumPy with
import numpy as np
We can create new arrays with
a = np.array([1, 5, 7])
We can specify number of dimensions or data types:
b = np.array([1, 2, 3], ndim=2)
c = np.array([1, 2, 3, 4], dtype=complex)
We can see the shape of an array via
print(a)
print(a.shape)
You can set the shape of an array
d = np.array([1, 2, 3], [4, 5, 6])
d.shape = (3, 2)
To create an array in a range
a = np.arange(24)
We can reshape this new array:
If we already have a Python list, we can create a NumPy array from it:
x = [1, 2, 3]
a = np.asarray(x)
Pandas #
- High performance data manipulation and data analysis
DataFrame
object, default and customized indexing- High efficient merging and joining of data
- Columns from a data structure can be deleted or inserted
- Label based slicing, indexing of large datasets
Structures #
Series
, 1D labeled homogenous arrayDataFrame
, 2D labeled hetergenously typed columnsPanel
, 3D labeled, size mutable array
Plotting #