Q. What will be the output of the following code ?


import pandas as pd
import numpy as np
data = np.array(['al', 'b1', 'c1', 'd1', 'e1', 'f1'])
s = pd.Series (data))
print("I.")
print (s[:3])
print("II.")
print (s[-3:])

Answer :-

I.
0    al
1    b1
2    c1
dtype: object
II.
3    d1
4    e1
5    f1
dtype: object

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post