Skip to content
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

BUG: fix DataFarame column slice indexer #6525

Merged
merged 1 commit into from Mar 3, 2014

Conversation

immerrr
Copy link
Contributor

@immerrr immerrr commented Mar 3, 2014

The code pulled in in #6123 didn't account for slice indexers which return views, not copies in take_ref_locs function. As a result, slice across columns corrupted _ref_locs of the parent block (provided _ref_locs existed). This PR should fix that.

In [1]: df = pd.DataFrame(np.random.rand(5,3))

In [2]: df.dtypes
Out[2]: 
0    float64
1    float64
2    float64
dtype: object

In [3]: df.iloc[:,2:]
Out[3]: 
          2
0  0.524160
1  0.072608
2  0.289047
3  0.494401
4  0.235275

[5 rows x 1 columns]

In [4]: _3.dtypes
Out[4]: 
2    float64
dtype: object

In [5]: df.dtypes
Out[5]: 
0    float64
1    float64
2       None
dtype: object

In [6]: pd.__version__
Out[6]: '0.13.1-346-g30d3cba'

jreback added a commit that referenced this pull request Mar 3, 2014
BUG: fix DataFarame column slice indexer
@jreback jreback merged commit 47785e3 into pandas-dev:master Mar 3, 2014
@jreback
Copy link
Contributor

jreback commented Mar 3, 2014

perfect...sometimes if i fix a bug I would just add on the issue to the previous one....but this is fine too
thanks

@immerrr immerrr deleted the fix-df-column-slice-indexer branch March 3, 2014 14:54
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.

None yet

2 participants