Write SQL and Python, run instantly in your browser, and track your progress.
You are a Data Analyst at Meta. The Engagement team wants to create a unified activity log combining posts and reactions. Since these DataFrames have different schemas (posts have content_type but reactions have reaction_type), you'll need to concatenate them and handle the missing columns appropriately.
| Column Name | Type |
|---|---|
| post_id | int64 |
| user_id | int64 |
| content_text | object |
| content_type |
You are a Data Analyst at Meta. The Engagement team wants to create a unified activity log combining posts and reactions. Since these DataFrames have different schemas (posts have content_type but reactions have reaction_type), you'll need to concatenate them and handle the missing columns appropriately.
| Column Name | Type |
|---|---|
| post_id | int64 |
| user_id | int64 |
| content_text | object |
| content_type |
| object |
| object |
| link_url | object |
| link_url | object |
| visibility | object |
| visibility | object |
| created_at | object |
| created_at | object |
| status | object |
| status | object |
| Column Name | Type |
|---|---|
| reaction_id | int64 |
| entity_type | object |
| entity_id | int64 |
| user_id | int64 |
| reaction_type | object |
| created_at | object |
| Column Name | Type |
|---|---|
| reaction_id | int64 |
| entity_type | object |
| entity_id | int64 |
| user_id | int64 |
| reaction_type | object |
| created_at | object |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| post_id | user_id | content_text | content_type | link_url | visibility | created_at | status |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Answering your questions about entrepreneurship | video | followers | 2025-05-28 17:39:24 |
| reaction_id | entity_type | entity_id | user_id | reaction_type | created_at |
|---|---|---|---|---|---|
| 1 | post | 1 | 44 | support | 2025-08-29 21:55:01 |
| 2 | post | 1 |
| reaction_id | entity_type | entity_id | user_id | reaction_type | created_at |
|---|---|---|---|---|---|
| 1 | post | 1 | 44 | support | 2025-08-29 21:55:01 |
| 2 | post | 1 |
| activity_id | user_id | activity_type | content_type | reaction_type | created_at |
|---|---|---|---|---|---|
| 811 | 18 | reaction | none | like | 2025-08-31 23:59:40 |
| 812 | 32 | reaction | none | love | 2025-08-31 23:57:43 |
| 909 | 43 |
| activity_id | user_id | activity_type | content_type | reaction_type | created_at |
|---|---|---|---|---|---|
| 811 | 18 | reaction | none | like | 2025-08-31 23:59:40 |
| 812 | 32 | reaction | none | love | 2025-08-31 23:57:43 |
| 909 | 43 |
Showing first 5 of 1638 rows.
Showing first 5 of 1638 rows.
1. DataFrames:
2. Preparation:
3. Concatenation:
4. Output:
1. DataFrames:
2. Preparation:
3. Concatenation:
4. Output:
| published |
| published |
| 2 | 1 | For everyone asking about technology... | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 2 | 1 | For everyone asking about technology... | link | https://example.com/41544 | public | 2025-04-20 09:23:49 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 3 | 1 | Sunset vibes from Austin | image | followers | 2025-06-02 01:35:31 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 4 | 2 | What's your take on web development? | poll | followers | 2025-07-19 11:27:33 | published |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 5 | 2 | Morning coffee and good vibes | image | followers | 2025-08-04 14:31:30 | hidden |
| 13 |
| 13 |
| love |
| love |
| 2025-06-23 13:00:52 |
| 2025-06-23 13:00:52 |
| 3 | post | 2 | 28 | like | 2025-07-25 14:54:33 |
| 3 | post | 2 | 28 | like | 2025-07-25 14:54:33 |
| 4 | post | 3 | 22 | insightful | 2025-08-26 16:15:24 |
| 4 | post | 3 | 22 | insightful | 2025-08-26 16:15:24 |
| 5 | post | 3 | 50 | like | 2025-08-11 13:16:54 |
| 5 | post | 3 | 50 | like | 2025-08-11 13:16:54 |
| reaction |
| reaction |
| none |
| none |
| funny |
| funny |
| 2025-08-31 23:55:56 |
| 2025-08-31 23:55:56 |
| 927 | 38 | reaction | none | like | 2025-08-31 23:41:42 |
| 927 | 38 | reaction | none | like | 2025-08-31 23:41:42 |
| 910 | 59 | reaction | none | insightful | 2025-08-31 23:34:57 |
| 910 | 59 | reaction | none | insightful | 2025-08-31 23:34:57 |