Correct option is D
The given code creates a
Pandas Series from a list [100, 200, 300] and prints it.
import pandas as pd
S1 = pd.Series([100, 200, 300])
print(S1)
· The
pd.Series() function automatically assigns an integer index starting from 0 to the elements of the list.
· Since no other index is specified, the default index is used: 0, 1, 2.
· The elements [100, 200, 300] are interpreted as integer values.
· The
dtype will be int64 because the elements are integers.
Thus, the output will be:
0 100
1 200
2 300
dtype: int64
Important Key Points:
1.
pd.Series(): This function creates a one-dimensional array-like object, with a default integer index starting from 0.
2.
dtype: Since the input data is a list of integers, the data type of the resulting series is
int64.
3.
Default Indexing: When no custom index is specified, Pandas automatically assigns a default index starting from 0.
Knowledge Booster:
·
Option (a): This is incorrect because the index starts at 0 by default, not 1.
·
Option (b): This is incorrect because the default data type for integers is int64, not float64.
·
Option (c): This is incorrect because the index should start at 0, not 1, and the data type is int64, not float64.