Skip to content

Commit f22fd7b

Browse files
committed
Removed tolist fully
1 parent 2bc43bc commit f22fd7b

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

pandas/core/dtypes/cast.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,24 +1223,3 @@ def construct_1d_object_array_from_listlike(values):
12231223
result = np.empty(len(values), dtype='object')
12241224
result[:] = values
12251225
return result
1226-
1227-
1228-
def tolist(values):
1229-
"""Convert an array-like to a list of scalar types.
1230-
1231-
Parameters
1232-
----------
1233-
values : ndarray or ExtensionArray
1234-
1235-
Returns
1236-
-------
1237-
list
1238-
Each element of the list is a Python scalar (str, int, float)
1239-
or a pandas scalar (Timestamp / Timedelta / Interval / Period) or
1240-
the scalar type for 3rd party Extension Arrays.
1241-
1242-
See Also
1243-
--------
1244-
Series.tolist
1245-
numpy.ndarray.tolist
1246-
"""

pandas/tests/dtypes/test_cast.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
maybe_convert_scalar,
2424
find_common_type,
2525
construct_1d_object_array_from_listlike,
26-
construct_1d_arraylike_from_scalar,
27-
tolist)
26+
construct_1d_arraylike_from_scalar)
2827
from pandas.core.dtypes.dtypes import (
2928
CategoricalDtype,
3029
DatetimeTZDtype,
@@ -325,18 +324,6 @@ def test_maybe_convert_objects_copy(self):
325324
out = maybe_convert_objects(values, copy=True)
326325
assert values is not out
327326

328-
@pytest.mark.parametrize('values, expected', [
329-
(pd.date_range('2017', periods=1), [pd.Timestamp('2017')]),
330-
(pd.period_range('2017', periods=1, freq='D'),
331-
[pd.Period('2017', freq='D')]),
332-
(pd.timedelta_range(0, periods=1), [pd.Timedelta('0')]),
333-
(pd.interval_range(0, periods=1), [pd.Interval(0, 1)]),
334-
(np.array([0, 1]), [0, 1]),
335-
])
336-
def test_tolist(self, values, expected):
337-
result = tolist(values)
338-
assert result == expected
339-
340327

341328
class TestCommonTypes(object):
342329

0 commit comments

Comments
 (0)