Pandas is a Python library built on top of NumPy for data manipulation and analysis, providing data structures (DataFrame + Series) and tools to clean, transform, and aggregate structured data.
Series
is a 1 dimensional NumPy array == Dataframe Column
Pandas Dataframe:

NumPy is a Python library used for working with arrays. It also has functions to work in the domain of linear algebra, fourier transform and matrices.
It was created in 2005 by Travis Oliphant as an open source project. A NumPy array object is up to 50x faster than traditional Python Lists:
import numpy as np
var1DArray = np.array(
[1, 2, 3, 4, 5]
)
print('2nd element: ', var1DArray[1]) # 2
var2DArray = np.array(
[
[1, 2, 3],
[4, 5, 6]
]
)
print('3th element on 1st row: ', var2DArray[0, 2]) # 3NumPy Vectorized Operations allow for fast, element-wise computations on arrays without explicit loops.

array1 = np.array(
[1, 2, 3, 4, 5]
)
array2 = np.array(
[2, 1, 4, 2, 1]
)
# Non-vectorized - slow
multiplyScalar = [x * 2 for x in array1]
# Vectorized - very fast
multiplyScalar = array1 * 2
multiplyArrays = array1 * array2
addArrays = array1 + array2
subArrays = array1 - array2
# Error: most functions only work for scalar values
divideArrays = round( array1 / array2, 1)
# Correct: np.round supports Vectorized Operations
divideArrays = np.round(array1 / array2,1) Before you can start using pandas Dataframes you first need to install the package:
!pip install pandasIn Pandas each column is a Series
import pandas as pd
# Series == Array of elements/items
series = pd.Series([1001, 1002, 1003, 1004, 1005])A Dataframe is a Dictionary of Series:
from datetime import date, datetime, timedelta
# Dataframe == Dictionary + Series
dataframe = pd.DataFrame(
{
'OrderID': [1001, 1002, 1003, 1004, 1005],
'CustomerID': [5, 3, 2, 4, 6],
'OrderDate': [date(2023,3,2), date(2023,3,15),date(2023,3,30), date(2023,4,2), date(2023,4,11)],
'ShipDate': [date(2023,3,6), date(2023,3,16),date(2023,4,1), date(2023,4,6), date(2023,4,15)],
'CustomerName': ['John', 'Mike','Jane', 'Tom', 'Angela'],
'ProductID': [101, 202, 203, 404, 606],
'Qty': [1, 2, 1, 4, 10],
'Price': [2.15, 2.59, 4.08, 1.55, 3.54]
}
)
dataframe.info()
To learn more about DataFrame transformations go to: Pandas – Dataframe Basics.