merge()缺少1个必需的位置参数:'right'

时间:2016-09-19 13:35:27

标签: python pandas

我正在做一个教程,我遇到了一个问题: 我的代码:

import html5lib 
import quandl
import pandas as pd
import pickle

pd.read_html("https://simple.wikipedia.org/wiki/List_of_U.S._states")
main_df = pd.DataFrame()
fiddy_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
for abbv in fiddy_states[0][0][1:]:
    query = "FMAC/HPI_"+str(abbv)
    df = quandl.get(query)

if main_df.empty:
    main_df = df 
else:
    main_df = pd.merge (main_df , df, how = "right")
print(pd.merge(main_df))

,我的错误是

TypeError: merge() missing 1 required positional argument: 'right'

怎么了?

2 个答案:

答案 0 :(得分:0)

main_df.merge(df, how = "right")

答案 1 :(得分:0)

hello hello hello hello hello hello基本上是指右侧的数据框。根据您的情况,应从合并命令中删除right,然后选择df。这将起作用。