Repository: data-8/datascience

Issue:
Table.remove() converts columns into lists
When using `Table.remove()`, the type of the columns in a table become lists.  They should remain arrays.  See attached notebook for an example.

[TableRemoveOddity.zip](https://github.com/data-8/datascience/files/7174805/TableRemoveOddity.zip)

Sample code to reproduce:

```
>>> newTable = Table().with_columns(
        "Teams", make_array('Aces', 'Bears', 'Cats', 'Dogs', 'Eagles', 'Ferrets'),
        "Scores", make_array(93, 87, 92, 75, 96, 68)
    )
>>> newTable.remove(0)
>>> newTable.column('Scores')
[87, 92, 75, 96, 68]
>>> type(newTable.column('Scores'))
list
```

Looking at the implementation of `.remove()` (https://github.com/data-8/datascience/blob/master/datascience/tables.py#L1118), we can immediately see the problem:

```
for col in self._columns:
            self._columns[col] = [elem for i, elem in enumerate(self[col]) if i not in rows_remove]
```

It creates a list, not an array.   I believe this should be fixed to create an array.

(Seeing as `.remove()` is also side-effecting and we are trying to promote non-side-effecting methods where appropriate, we could consider deprecating `.remove()` anyway and pointing people to `.exclude()`.)

Thanks to Dan Kaiser for this bug report.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8944b469..eabf6fa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 
 ### v0.17.5
 * Eliminated deprecation warnings involved arrays containing arrays/sequences.
+* Changed the column type of a table after a remove operation back to a NumPy array, as written in the documentation.
 
 ### v0.17.4
 * Changes maps.Circle's default line color from blue to the fill color, if it is defined.
diff --git a/datascience/tables.py b/datascience/tables.py
index 17b94a29..6b02a633 100644
--- a/datascience/tables.py
+++ b/datascience/tables.py
@@ -1124,7 +1124,7 @@ class Table(collections.abc.MutableMapping):
         else:
             rows_remove = row_or_row_indices
         for col in self._columns:
-            self._columns[col] = [elem for i, elem in enumerate(self[col]) if i not in rows_remove]
+            self._columns[col] = np.array([elem for i, elem in enumerate(self[col]) if i not in rows_remove])
         self._num_rows -= len(rows_remove)
         return self
 


Test patch:
diff --git a/tests/test_tables.py b/tests/test_tables.py
index fc8cafe5..f0abfbd7 100644
--- a/tests/test_tables.py
+++ b/tests/test_tables.py
@@ -1145,6 +1145,13 @@ def test_remove_num_rows(table):
     table.remove(0)
     assert table.num_rows + 1 == num_rows_before
 
+def test_remove_column_type(table):
+    original_col = table.column("count")
+    assert type(original_col) == np.ndarray
+    table.remove(0)
+    assert type(table.column("count")) == type(original_col)
+
+
 
 ##########
 # Create #