codegurukool.com · Free coding tutorials & online compiler

Home › Python Tutorial › NumPy, Pandas and Matplotlib

NumPy, Pandas and Matplotlib

Libraries for data work.

Install with pip install numpy pandas matplotlib. NumPy does fast maths on arrays, Pandas works with tables of data, and Matplotlib draws charts such as lines, bars, histograms and pies.

Example code

import numpy as np
import pandas as pd

a = np.array([1, 2, 3, 4])
print(a * 2)
print(a.mean())

df = pd.DataFrame({"name": ["Ada", "Bob"], "age": [36, 25]})
print(df["age"].mean())

Run this code in the online editor

← Python file handlingPython statistics and machine learning basics →