pandas字典合并

import numpy as np
import pandas as pd

columns = ['java', 'python', 'c++']
dates = np.arange(6)
num_df = pd.DataFrame(data=np.random.randn(6, 3), index=dates, columns=columns)
print(num_df)

columns = ['php']
dates = [2, 3, 4]
v = np.array([[0.33], [0.44], [0.55]])
num_df2 = pd.DataFrame(data=v, index=dates, columns=columns)
print(num_df2)

zz = num_df.join(num_df2, how='left')
print(zz)

pandas字典合并

 

上一篇:SQL


下一篇:【静态路由配置实验】某公司有一个总部和两个分部,分别都是一个独立的局域网。