-1
我有一個我想要轉換成數據框表的字典列表。我知道,在標題的問題是有點混亂,所以生病後的詞典:將列表字典列表轉換爲Python中的DataFrame表
[{'MESSAGE': ['RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS'], 'BIN': ['8FHA9D83H 82HG7D9F'], 'INV': 'SSXR 98-20LM NM CORN CREAM'}, {'MESSAGE': ['RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS', '#2956- INVALID STOCK COUPON CODE (MISSING).', 'RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS'], 'BIN': ['HA8DHWO2H HAHD0138', '8SHDNAIDU 00AD0123', '938273548 0967HDBR'], 'INV': 'FPBC *SOUP CANS LENTILS'}]
我試過大熊貓的方法很多,但因爲有每個鍵多個值,這是一個稍微難一點的問題解決。我試圖調整pd.DataFrame的傳統方法,但我無法弄清楚。我需要的DF表顯示此輸出打印時:
BIN INV CODE MESSAGE
8FHA9D83H82HG7D9F SSXR-98-20LM NM CORN CREAM RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS
HA8DHWO2HHAHD0138 FPBC-*SOUP CANS LENTILS RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS
8SHDNAIDU00ADFPBC-*SOUP CANS LENTILS #2956- INVALID STOCK COUPON CODE (MISSING).
9382735480967HDBR FPBC-*SOUP CANS LENTILS RECEIVED SUCCESSFULLY AWAITING STOCKING PROCESS
我很新到Python 2.7,所以任何幫助,將不勝感激:)
謝謝!我愛你.... –