现实中的数据连接

面向表格用户的 pandas 连接

John Miller

Principal Data Scientist

混合使用列与索引

列与索引混用

teams.merge(positions, left_on='player_id', right_index=True)

or

positions.merge(teams, left_index=True, right_on='player_id')
面向表格用户的 pandas 连接

处理重名列

重名列

current.merge(drafted, on='name', suffixes=('_current', '_drafted'))
面向表格用户的 pandas 连接

按表识别行

表来源指示器

current.merge(drafted, how='outer', on='name', suffixes=('_current', '_drafted'),
               indicator=True)
面向表格用户的 pandas 连接

按键对行排序

按键排序的行

current.merge(drafted, on='name', suffixes=('_current', '_drafted'),
               sort=True)
面向表格用户的 pandas 连接

Passons à la pratique !

面向表格用户的 pandas 连接

Preparing Video For Download...