Convert Dictionary to DataFrame
Company: Walmart Labs
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: hard
Interview Round: Technical Screen
Using Python and pandas, convert the following dictionary into a DataFrame. Each top-level key is a target column name, and each value is a list of `[row_id, cell_value]` pairs. Use the first element of each pair as the row identifier, align rows by `row_id` across all keys, and produce a wide DataFrame with one row per `row_id` and one column per top-level key.
Input:
```python
data = {
'text1': [[123, '2'], [345, '3']],
'text2': [[123, '4'], [345, '4']]
}
```
Expected structure:
- `row_id = 123` -> `text1 = '2'`, `text2 = '4'`
- `row_id = 345` -> `text1 = '3'`, `text2 = '4'`
Write Python code to create the DataFrame.
Quick Answer: This question evaluates proficiency in Python data manipulation and pandas DataFrame construction, specifically handling nested list structures and aligning rows by identifiers.