运行 ❯
获取您自己的
Python
服务器
×
更改方向
更改主题,明暗色
转到 Spaces
import pandas as pd data1 = { "name": ["Sally", "Mary", "John"], "age": [50, 40, 30] } data2 = { "qualified": [True, False, False] } df1 = pd.DataFrame(data1) df2 = pd.DataFrame(data2) newdf = df1.join(df2) print(newdf)
name age qualified 0 Sally 50 True 1 Mary 40 False 2 John 30 False