I am making api call via python sdk to get facebook insights dat and I am getting the following response from API. I would like to remove from response json object. can you please guide me how to do this? I have tried to serialize it by .dumps() but it does not serialize.
[
{
"account_id": "123"
},
{
"account_id": "123"
},
{
"account_id": "123"
}
]
Asked
Active
Viewed 170 times
0
-
I would like to remove< AdsInsights> from this json object [
{ "account_id": "123" }, – shamraiz shehzad Dec 31 '20 at 01:20{ "account_id": "123" }, { "account_id": "123" } ] -
solve by using dict – shamraiz shehzad Feb 17 '21 at 11:11
1 Answers
0
I'm pretty sure you can just cast the insights list into a Pandas Dataframe like:
insights_list = campaign.get_insights()
insights_df = pd.Dataframe(insights_list)
In this way you can have your metrics in the dataframe columns and it will improve the readability.

Sprizgola
- 416
- 2
- 10