I've got a dataframe as in the image:
I'd like to transform that into a dataframe similar to the following:
But, in the second image, instead of having (0,1,2...) as index, I want to keep card_id as index - or as a column, whatever.
The second image is obtained applying pd.json_normalize
in the first df's card_fields
column.
I did find something similar in this question, but in there we start with a dictionary, instead of a dataframe, as in my case, so the proposed solution is not directly translatable to my case without doing a lot of manipulation.