I have a data-frame that looks like
DATA
*id*, *name*, *URL*, *Type*
2, birth_france_by_region, http://abc. com, T1
2, birth_france_by_region, http://pt. python, T2
3, long_lat, http://abc. com, T3
3, long_lat, http://pqur. com, T1
4, random_time_series, http://sadsdc. com, T2
4, random_time_series, http://sadcadf. com, T3
5, birth_names, http://google. com, T1
5, birth_names, http://helloworld. com,T2
5, birth_names, http://hu. com, T3
I want a this dataframe to merge the rows where id are equal and have a list of dictionary's Type as key of dictionary URL as value so final output this :-
*id*, *name*, *URL*
2,birth_france_by_region, [{T1:http://abc .com},{T2:http://pt.python}]
3,long_lat, [{T3:http://abc .com},{T1:http://pqur. com}]
4,random_time_series, [{T2:http://sadsdc. com},{T3:http://sadcadf .com}]
5,birth_names, [{T1:http://google .com},{T2:http://helloworld. com},
{T3:http://hu. com}]