Computer Science · Python Pandas
Fill in the blank with the appropriate command to produce a DataFrame with columns designated by list A and row index designated by list B: import pandas as pd D = [[1, 2], [3, 4]] A = ['A1', 'A2'] B = ['B1', 'B2'] # Fill in the blank print(D)
- 1D = pd.DataFrame(A, B, D)
- 2D = pd.DataFrame(D, B, i = A)
- 3D = pd.DataFrame(D, rows = B, columns = A)
- 4D = pd.DataFrame(D, columns = A, index = B)✓
Correct answer
D = pd.DataFrame(D, columns = A, index = B)
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Python Pandas?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Python Pandas