Pandas Explode on Multiple columns
I guess you need (note the difference in data for col4
which has None
as OP mentioned):
pd.DataFrame([[i] if not isinstance(i,list) else i
for i in d1.values()],index=d1.keys()).T
user paid last_active col4
0 user1 Y 11 Jul 2019 data
1 user2 Y 23 Sep 2018 None
2 user3 N 08 Dec 2019 None
3 user4 N 03 Mar 2018 None