i have a dataframe with column business_id and attributes with thousands of rows like this:
+------------------------------------------------------------------------------------+-------------------+
| attributes | business_id|
+--------------------+---------------------------------------------------------------+-------------------+
|{"WiFi":"u'free","HasTV":"False","RestaurantsTableService":"True","Caters":"True".. |6iYb2HFDywm3zjuRg0q|
|{"HasTV:"False","Ambience":{'romantic': False, 'intimate': False,},"Price":"2" .... |7f4z43MHAV-l-LsRYsa|
+------------------------------------------------------------------------------------+-------------------+
how do create new column for each attribute with the value to the business id ? and if it's not applicable to that business id, it will specify false.
example:
+---------------+-------------+-------------------+
| Wifi| Price| business_id|
+---------------+-------------+-------------------+
| u'free| False|6iYb2HFDywm3zjuRg0q|
| False| 2|7f4z43MHAV-l-LsRYsa|
+---------------+-------------+-------------------+
while also noting that there are some attributes with value as object in an object like:
{..."Ambience":{'romantic': False, 'intimate': False}...}
for this, if possible, i would like to tag that values to the attribute like as the column name like:
Ambience.romantic
Would someone please help me with this if you know how?