-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversions
Description
In [1]: import pandas as pd
In [2]: s = pd.Series([1, 2, "1"])
...: s.sort_values()
TypeError: '<' not supported between instances of 'str' and 'int'
In [3]: s = pd.Series([1, 2])
...: s.searchsorted("1")
Out[3]: 0
In [4]: import numpy as np
In [5]: arr = np.array([1, 2])
In [6]: arr.searchsorted("1")
Out[6]: 0Looks like we are mirroring this behavior from numpy, but since Series does not support sorting incomparable objects then it seems like searchsorted with incomparable objects should raise too
Metadata
Metadata
Assignees
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversions