Skip to content

API/REGRESS: partial revert of f8b6208675b5b10d73a74f50478fa5e37b43fc02 (GH5720,GH5744) #5747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Dec 19, 2013

 allow assignment of a column in a frame with a scalar with no index (so adds to the columns),
 instead of raising; this preservers 0.12 behavior

related #5720, #5744

going back to 0.12 behavior
effectively can add a column by assigning a scalar to a frame that doesn't have an index
need a more compelling reason to raise here

In [4]: df = DataFrame({"A": [1, 2, 3], "B": [1.2, 4.2, 5.2]})

In [5]: y = df[df.A > 5]

In [6]: y
Out[6]: 
Empty DataFrame
Columns: [A, B]
Index: []

[0 rows x 2 columns]

In [7]: y['New'] = np.nan

In [8]: y
Out[8]: 
Empty DataFrame
Columns: [A, B, New]
Index: []

[0 rows x 3 columns]

     allow assignment of a column in a frame with a scalar with no index (so adds to the columns),
     instead of raising; this preservers 0.12 behavior
jreback added a commit that referenced this pull request Dec 19, 2013
API/REGRESS: partial revert of f8b6208 (GH5720,GH5744)
@jreback jreback merged commit 8ce7687 into pandas-dev:master Dec 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant