Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Aligning Series.index with DataFrame.index in broadcasting operations #30

Open
shoyer opened this issue Sep 26, 2016 · 1 comment
Open
Labels

Comments

@shoyer
Copy link

shoyer commented Sep 26, 2016

Copying my comment from pandas-dev/pandas#10000 (comment):

We should consider making arithmetic between a Series and a DataFrame broadcast across the columns of the dataframe, i.e., aligning series.index with df.index, rather than the current behavior aligning series.index with df.columns.

I think this would be far more useful than the current behavior, because it's much more common to want to do arithmetic between a series and all columns of a DataFrame. This would make broadcasting in pandas inconsistent with NumPy, but I think that's OK for a library that focuses on 1D/2D rather than N-dimensional data structures.

@wesm
Copy link
Owner

wesm commented Sep 26, 2016

I honestly might even go so far as disabling implicit broadcasting in favor of df.add(series, axis='index'). Perennial source of problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants