I had 1 dataset where all the services were appended into a list, so I converted them to rows as I am not aware of how to make them as column and use boolean as value which has been described below.
I tried other threads answer but could not reach to the final solution as I want my value to be boolean and I tried giving it True/False in a list but as we know the in order to evaluate True or False there should so logic, and I have no clue how to do that.
pivoted = df.pivot(index='Name', columns='Services', values=[True, False])\
.reset_index()
pivoted.columns.name=None
I have a dataset as below:
===========================================
Address Name Phone Service
abc, hyd India abc 8923 PPF
abc, hyd India abc 8923 EPF
abc, hyd India abc 8923 DAP
xyz, hyd india xyz 7576 EPF
===============================================
I want the result to be as:
==================================================
Address Name Phone PPF EPF DAP
abc, hyd India abc 8923 True True True
xyz, hyd india xyz 7576 False True False
=================================================================