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

damn pandas revert bugfixes

parent 1f7332de
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,6 @@ class DictOfSeries:
- ``dios.loc[..]`` loc[cation] based indexing, work on row and/or columns `labels`, align, return dios
- ``dios.iloc[..]`` i[nteger]loc[cation] based indexing, work on row and/or columns, align, return dios
Todos:
-----
"""
def __init__(self, data=None, columns=None, itype=MixedItype, downcast_policy='save'):
......@@ -192,9 +190,7 @@ class DictOfSeries:
new = self.copy_empty(columns=False)
for k in self.columns:
# bug-fix: must be .loc, simple
# ser[key] may work positional!
new._data.at[k] = self._data.at[k].loc[key]
new._data.at[k] = self._data.at[k][key]
return new
def _getitem_bool_dios(self, key):
......@@ -209,7 +205,7 @@ class DictOfSeries:
raise ValueError("Must pass DictOfSeries with boolean values only")
# align rows
idx = boolser[boolser].index.intersection(ser.index)
new._data.at[k] = ser.loc[idx]
new._data.at[k] = ser[idx]
return new
def _getitem_bool_listlike(self, key):
......@@ -239,7 +235,7 @@ class DictOfSeries:
for k in data.columns:
s = data._data.at[k]
s[:] = value
self._data.at[k].loc[s.index] = s
self._data.at[k][s.index] = s
def _setitem_dios(self, data, value):
keys = self.columns.intersection(data.columns)
......
from dios import *
from test.test_setup import *
from pandas.core.dtypes.common import is_scalar
# s1 = pd.Series(range(10), index=range(10))
# s2 = pd.Series(range(5, 10), index=range(5, 10))
......
......@@ -3,6 +3,7 @@ import pytest
from dios import *
import pandas as pd
from pandas.core.dtypes.common import is_dict_like, is_nested_list_like
import numpy as np
from copy import deepcopy
......
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