def test_strOrder_none() -> None: string = ['a', 'b', 'c', None] assert stp.str_order(string, na_last=False) == [3, 0, 1, 2]
def test_strOrder_natural() -> None: string = pd.Series(["100a10", "100a5", "2b", "2a"]) pd.testing.assert_series_equal(stp.str_order(string, numeric=True), pd.Series([3, 2, 1, 0]))
def test_strOrder_series() -> None: string = pd.Series(["100a10", "100a5", "2b", "2a"]) pd.testing.assert_series_equal(stp.str_order(string), pd.Series([0, 1, 3, 2]))
def test_strOrder_array() -> None: string = np.array(['this', 'is', 'happening']) np.testing.assert_array_equal(stp.str_order(string, decreasing=True), np.array([0, 1, 2]))
def test_strOrder_list() -> None: string = ['i', 'am', 'a', 'string'] assert stp.str_order(string) == [2, 1, 0, 3]
def test_strOrder_string() -> None: string = 'string' assert stp.str_order(string) == 0