Home »
Python »
Python Pandas MCQs
What will be the output of following code? | Pandas Questions 1
1. What will be the output of following code?
import pandas as pd
series1 = pd.Series([10,20,30,40,50])
print (series1)
-
0 10
1 20
2 30
3 40
4 50
dtype: int64
-
1 10
2 20
3 30
4 40
5 50
dtype: int64
-
0 10
1 20
2 30
3 40
4 50
dtype: float32
- None of the above mentioned
Answer: A)
0 10
1 20
2 30
3 40
4 50
dtype: int64
Explanation:
Pandas Series is a one-dimensional labeled array that may carry data of any type. It is used to store text, numbers, and other data like integers, strings, float, python objects, etc. The index labels are used to refer to the labels on the axes as a whole. Pandas Series can be considered as a column in an Excel file.