我正在尝试将DataFrame A内部连接到DataFrame B并遇到错误.
这是我的连接声明:
merged = DataFrameA.join(DataFrameB, on=['Code','Date'])
Run Code Online (Sandbox Code Playgroud)
这是错误:
ValueError: len(left_on) must equal the number of levels in the index of "right"
Run Code Online (Sandbox Code Playgroud)
我不确定列顺序是否重要(它们不是真正"有序"的吗?),但为了以防万一,DataFrames组织如下:
DataFrameA: Code, Date, ColA, ColB, ColC, ..., ColG, ColH (shape: 80514, 8 - no index)
DataFrameB: Date, Code, Col1, Col2, Col3, ..., Col15, Col16 (shape: 859, 16 - no index)
Run Code Online (Sandbox Code Playgroud)
我需要更正我的加入声明吗?或者是否有另一种更好的方法来获得这两个DataFrame的交集(或内连接)?