diff --git a/arkouda/dataframe.py b/arkouda/dataframe.py index e40d5de652..418c7fb94a 100644 --- a/arkouda/dataframe.py +++ b/arkouda/dataframe.py @@ -685,9 +685,7 @@ def __init__(self, initialdata=None, index=None, columns=None): if len(sizes) > 1: raise ValueError("Input arrays must have equal size.") self._empty = False - UserDict.__setitem__(self, key, val) - # Update the column index - self._columns.append(key) + self[key] = val # Initial data is a list of arkouda arrays elif isinstance(initialdata, list): @@ -711,9 +709,7 @@ def __init__(self, initialdata=None, index=None, columns=None): if len(sizes) > 1: raise ValueError("Input arrays must have equal size.") self._empty = False - UserDict.__setitem__(self, key, col) - # Update the column index - self._columns.append(key) + self[key] = col # Initial data is invalid. else: @@ -778,8 +774,7 @@ def __getitem__(self, key): raise TypeError("Invalid selector: too many types in list.") if isinstance(key[0], str): for k in key: - result.data[k] = UserDict.__getitem__(self, k) - result._columns.append(k) + result[k] = self[k] result._empty = False result._set_index(self.index) # column lens remain the same. Copy the indexing return result