Skip to content

Commit

Permalink
Closes Bears-R-Us#3116 remove DataFrame._columns
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Apr 29, 2024
1 parent 1fcbbd4 commit 6993791
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arkouda/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6993791

Please sign in to comment.