0
我有一個數據幀,其中features
-column的值是字典般如下:字典的重映射值快譯通到列大熊貓
http://screencast.com/t/0Ko0NIBLwo
features name price rating read reviews
9 {'Cooking...': '- S...', } Master Chef... $279.99 None None {}
例如:
{u'Cooking Type': u'- Specialty Cooking', u'Cooking Area': u'- Backyard', u'Brand Name': u'- Pizzacraft', u'Fuel Type': u'- Propane', u'Product Type': u'- BBQ', u'Size': u'- Medium Size'}
是否有可能將這些值轉換爲新列?
features Cooking Type Specialty Cooking ... name price rating read reviews
9 {'Cooking...': '- S...', } Specialty Cooking Backyard ... Master Chef... $279.99 None None {}
如何我'NaN'和'{}'值奮鬥?如果isinstance(x,dict)和x],index = df.index)引發錯誤* ValueError:傳遞值的形狀是(17, 66),指數意味着(17,105)* – SpanishBoy
是的,這是問題。一種解決方法是將'NaN'替換爲'{}' - [see](http://stackoverflow.com/a/34991815/2901002) – jezrael