# Your code here
df1 = pd.DataFrame( {'A' : [1,2,3]})
df2 = pd.DataFrame({'B': [1,4,5]})
pd.merge([df1,df2], left_index=True,right_index=True)

TypeError                                 Traceback (most recent call last)
<ipython-input-28-1a158d54d1f6> in <module>()
pd.merge([df1,df2], left_index=True,right_index=True)

TypeError: merge() takes at least 2 arguments (3 given)

Problem description

The error message thrown is because the merge function expects two non-keyword args. However the current error message is unhelpful and a bit confusing.

Expected Output

TypeError(): merge() takes at least 2 non-keyword arguments (1 given)

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 2.7.13.final.0 python-bits: 64 OS: Darwin OS-release: 16.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: None.None pandas: 0.21.0 pytest: None pip: 9.0.1 setuptools: 32.1.0 Cython: None numpy: 1.13.3 scipy: 0.19.1 pyarrow: None xarray: None IPython: 5.4.1 sphinx: None patsy: None dateutil: 2.6.1 pytz: 2017.3 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: 4.6.0 html5lib: 0.9999999 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.9.6 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None

Comment From: jreback

incorrect argument passing where some are required are intercepted before pandas even sees the call. IOW, this is de-facto the same as.

In [6]: open()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-3eee29e366d3> in <module>()
----> 1 open()

TypeError: Required argument 'file' (pos 1) not found