NumPy & Pandas Basics
Download original notebook: [NumPy-Pandas Basics.ipynb](/notebooks/NumPy-Pandas Basics.ipynb)
NumPy-Pandas Basics
Combined notebook — sections below are preserved verbatim from their originals.
Untitled6
Merged from Untitled6.ipynb (2022-05-31)
import numpy as np
a=([2,3,4],
[4,5,6],
[6,7,8])
a.shape
a.size
Untitled10
Merged from Untitled10.ipynb (2023-03-04)
import numpy as np
np.array([1,2,3,4])
np.zeros([3,4],dtype=int)
np.array([[(1.5,2,3), (4,5,6)] ,[(3,2,1), (4,5,6)]],dtype=float)
np.ones([3,4], dtype=np.int16)
np.arange(10,25,5)
np.linspace(0,2,9,dtype=int)
np.full((2,2),(7,6))
np.eye(10)
np.random.random((2,10))
np.empty((2,2))
np.save("my" , a)
np.info(np.ndarray.dtype)
a = np.random.random([20,20])
a
g = a-b
array([[-0.5,0. ,0.],[-3. , 3. , 3. ]])
import pandas as pd
df = pd.read_csv("/content/Cricket - Sheet1.csv")
df
df["Out"] = [40,39,5,15,25,10]
df