DataFrame can be created from:
(A) series
(B) lists
(C) numpy
(D) dictionary
DataFrame can be created from:
(A) series
(B) lists
(C) numpy
(D) dictionary
Solution
✅ Correct Option: 3
A pandas DataFrame can be built from a Series, a list, a NumPy array or a dictionary, so all four (A), (B), (C) and (D) are correct.
| Source | Example |
|---|---|
| Series | pd.DataFrame(s) |
| List (or list of lists) | pd.DataFrame([[1, 2], [3, 4]]) |
| NumPy array | pd.DataFrame(np.array([[1, 2], [3, 4]])) |
| Dictionary | pd.DataFrame({'a': [1, 2], 'b': [3, 4]}) |
A dictionary of Series or lists is the most common method, with the keys becoming the column names.
Related questions:
2026: 21 May Shift 1
2026: 11 May Shift 2
2026: 18 May Shift 2