8000 BUG: Check for size != 0 before trying to insert #10193 by rekcahpassyla · Pull Request #10194 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Check for size != 0 before trying to insert #10193 #10194

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

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set is_copy and call _check_setitem_copy to trigger warning
  • Loading branch information
rekcahpassyla committed May 26, 2015
commit 0bef2a0286e2d4839c574974b8da88c3676ff2fd
6 changes: 5 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,10 @@ def _get_with(self, key):
# other: fancy integer or otherwise
if isinstance(key, slice):
indexer = self.index._convert_slice_indexer(key, kind='getitem')
return self._get_values(indexer)
values = self._get_values(indexer)
is_copy = values._is_view
values._set_is_copy(self, copy=is_copy)
return values
elif isinstance(key, ABCDataFrame):
raise TypeError('Indexing a Series with DataFrame is not supported, '\
'use the appropriate DataFrame column')
Expand Down Expand Up @@ -684,6 +687,7 @@ def setitem(key, value):
# do the setitem
cacher_needs_updating = self._check_is_chained_assignment_possible()
setitem(key, value)
self._check_setitem_copy()
if cacher_needs_updating:
self._maybe_update_cacher()

Expand Down
0