📜  dic 到 dic 数组的长度必须相同 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:47.503000             🧑  作者: Mango

代码示例1
import pandas as pd
import numpy as np

d = dict( A = np.array([1,2]), B = np.array([1,2,3,4]) )
    
pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in d.items() ]))

Out[7]: 
    A  B
0   1  1
1   2  2
2 NaN  3
3 NaN  4