Arrange the following statements in proper sequence:-
(A) series1 = pd.Series(array1)
(B) import pandas as pd
(C) array1 = np. array ([1, 2, 3, 4, 5])
(D) import numpy as np
Arrange the following statements in proper sequence:-
(A) series1 = pd.Series(array1)
(B) import pandas as pd
(C) array1 = np. array ([1, 2, 3, 4, 5])
(D) import numpy as np
Solution
✅ Correct Option: 1
(B) import pandas as pd loads the pandas library, so pd is defined.
(D) import numpy as np loads NumPy, so np is defined.
(C) array1 = np.array([1, 2, 3, 4, 5]) needs np, so it comes after the imports.
(A) series1 = pd.Series(array1) needs both pd and array1, so it comes last.
Options 2 and 3: (A) uses array1 before it has been created, which gives a NameError.
Option 4: (C) uses np before NumPy is imported, which gives a NameError.
Related questions:
2026: 18 May Shift 2
2025: 30 May Shift 2
2026: 21 May Shift 1
2026: 23 May Shift 2