Skip to main content

Program to select the elements from a given matrix

· One min read
Kaustubh Kulkarni

Code >

file.py
import pandas as pd
import numpy as np
data = np.array(['Dwayne','John','Steve','Hulk','Orton','Leo','Kofi'])
ser = pd.Series(data)
print(ser[:3])

Output >

Output
Dwayne
John
Steve