Last active
October 6, 2021 13:16
-
-
Save RizqiEka/d06ed5530cb84fe38b21f0e84a5d4a53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize Empty Container | |
engagement_list = [] | |
impressions_list = [] | |
reach_list = [] | |
saved_list = [] | |
# Loop Over Insights to Fill Container | |
for insight in media_insight: | |
engagement_list.append(insight[0]['values'][0]['value']) | |
impressions_list.append(insight[1]['values'][0]['value']) | |
reach_list.append(insight[2]['values'][0]['value']) | |
saved_list.append(insight[3]['values'][0]['value']) | |
# Create DataFrame | |
df_media_insight = pd.DataFrame(list(zip(engagement_list, impressions_list, reach_list, saved_list)), columns =['Engagement', 'Impressions', 'Reach', 'Saved']) | |
df_media_insight.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment