Join on level between two UNIQUE MultiIndex objects with unique level broadcast #15417
Labels
Duplicate Report
Duplicate issue or pull request
MultiIndex
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Performing simple arithmetic operations between two
DataFrames
that have a MultiIndex on the columns is disabled because the join on level is deemed ambiguous. This is not the case when the labels in bothDataFrame
s are unique and there is a unique mapping between the two and the MultiIndex levels are uniquely labeled.First, let's just construct the DataFrame.
In the case that there is a unique mapping between the two
DataFrames
such that there is a single level over which to broadcast, aTypeError
is currently raised.This solution provides a simple tool for many users, removing the necessity of a common for loop and manual index selection. The expected output would be something like
Output of
pd.show_versions()
pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 26.1.1
Cython: None
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: