Skip to content
Snippets Groups Projects
Commit ffe8fbbd authored by Bert Palm's avatar Bert Palm 🎇
Browse files

fixed pandas bug

parent ec057bcf
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,7 @@ class DictOfSeries: ...@@ -190,7 +190,7 @@ class DictOfSeries:
else: else:
# work on columns # work on columns
new = self.copy_empty(columns=False) new = self.copy_empty(columns=False)
new._data = self._data[key] new._data = self._data.loc[key]
return new return new
def _slice(self, key): def _slice(self, key):
...@@ -200,7 +200,9 @@ class DictOfSeries: ...@@ -200,7 +200,9 @@ class DictOfSeries:
new = self.copy_empty(columns=False) new = self.copy_empty(columns=False)
for k in self.columns: for k in self.columns:
new._data.at[k] = self._data.at[k][key] # bug-fix: must be .loc, simple
# ser[key] may work positional!
new._data.at[k] = self._data.at[k].loc[key]
return new return new
def _getitem_bool_dios(self, key): def _getitem_bool_dios(self, key):
...@@ -235,7 +237,7 @@ class DictOfSeries: ...@@ -235,7 +237,7 @@ class DictOfSeries:
if isinstance(value, pd.Series): if isinstance(value, pd.Series):
self._insert(key, value) self._insert(key, value)
else: else:
self._data.at[key].loc[:] = value self._data.at[key][:] = value
else: else:
data = self.__getitem__(key) data = self.__getitem__(key)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment