/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
pandas
/
tests
/
series
/
methods
/
/usr/local/lib64/python3.6/site-packages/pandas/tests/series/methods
mkdir
upload
Name
Size
Mode
Actions
__pycache__/
-
0755
rm
test_align.py
5359
0644
edit
dl
rm
test_append.py
9600
0644
edit
dl
rm
test_argsort.py
2249
0644
edit
dl
rm
test_asfreq.py
3616
0644
edit
dl
rm
test_asof.py
5515
0644
edit
dl
rm
test_astype.py
2628
0644
edit
dl
rm
test_at_time.py
2629
0644
edit
dl
rm
test_autocorr.py
999
0644
edit
dl
rm
test_between.py
1197
0644
edit
dl
rm
test_between_time.py
5086
0644
edit
dl
rm
test_clip.py
3384
0644
edit
dl
rm
test_combine.py
627
0644
edit
dl
rm
test_combine_first.py
3411
0644
edit
dl
rm
test_compare.py
3734
0644
edit
dl
rm
test_convert_dtypes.py
9914
0644
edit
dl
rm
test_count.py
1123
0644
edit
dl
rm
test_cov_corr.py
5215
0644
edit
dl
rm
test_describe.py
4640
0644
edit
dl
rm
test_diff.py
2331
0644
edit
dl
rm
test_drop.py
2986
0644
edit
dl
rm
test_droplevel.py
629
0644
edit
dl
rm
test_drop_duplicates.py
6850
0644
edit
dl
rm
test_duplicated.py
996
0644
edit
dl
rm
test_equals.py
1295
0644
edit
dl
rm
test_explode.py
3538
0644
edit
dl
rm
test_fillna.py
6513
0644
edit
dl
rm
test_first_and_last.py
2042
0644
edit
dl
rm
test_head_tail.py
343
0644
edit
dl
rm
test_interpolate.py
27757
0644
edit
dl
rm
test_isin.py
3445
0644
edit
dl
rm
test_nlargest.py
7121
0644
edit
dl
rm
test_pct_change.py
2968
0644
edit
dl
rm
test_quantile.py
6810
0644
edit
dl
rm
test_rank.py
20287
0644
edit
dl
rm
test_reindex_like.py
1245
0644
edit
dl
rm
test_rename.py
3378
0644
edit
dl
rm
test_rename_axis.py
1503
0644
edit
dl
rm
test_replace.py
15559
0644
edit
dl
rm
test_reset_index.py
4636
0644
edit
dl
rm
test_round.py
1970
0644
edit
dl
rm
test_searchsorted.py
2121
0644
edit
dl
rm
test_shift.py
12595
0644
edit
dl
rm
test_sort_index.py
12277
0644
edit
dl
rm
test_sort_values.py
7981
0644
edit
dl
rm
test_to_dict.py
742
0644
edit
dl
rm
test_to_period.py
1755
0644
edit
dl
rm
test_to_timestamp.py
2616
0644
edit
dl
rm
test_truncate.py
5557
0644
edit
dl
rm
test_tz_convert.py
1008
0644
edit
dl
rm
test_tz_localize.py
3108
0644
edit
dl
rm
test_unstack.py
4208
0644
edit
dl
rm
test_update.py
4213
0644
edit
dl
rm
test_value_counts.py
8136
0644
edit
dl
rm
__init__.py
225
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/pandas/tests/series/methods/test_searchsorted.py
(2121B)
import numpy as np from pandas import Series, Timestamp, date_range import pandas._testing as tm from pandas.api.types import is_scalar class TestSeriesSearchSorted: def test_searchsorted(self): ser = Series([1, 2, 3]) result = ser.searchsorted(1, side="left") assert is_scalar(result) assert result == 0 result = ser.searchsorted(1, side="right") assert is_scalar(result) assert result == 1 def test_searchsorted_numeric_dtypes_scalar(self): ser = Series([1, 2, 90, 1000, 3e9]) res = ser.searchsorted(30) assert is_scalar(res) assert res == 2 res = ser.searchsorted([30]) exp = np.array([2], dtype=np.intp) tm.assert_numpy_array_equal(res, exp) def test_searchsorted_numeric_dtypes_vector(self): ser = Series([1, 2, 90, 1000, 3e9]) res = ser.searchsorted([91, 2e6]) exp = np.array([3, 4], dtype=np.intp) tm.assert_numpy_array_equal(res, exp) def test_searchsorted_datetime64_scalar(self): ser = Series(date_range("20120101", periods=10, freq="2D")) val = Timestamp("20120102") res = ser.searchsorted(val) assert is_scalar(res) assert res == 1 def test_searchsorted_datetime64_scalar_mixed_timezones(self): # GH 30086 ser = Series(date_range("20120101", periods=10, freq="2D", tz="UTC")) val = Timestamp("20120102", tz="America/New_York") res = ser.searchsorted(val) assert is_scalar(res) assert res == 1 def test_searchsorted_datetime64_list(self): ser = Series(date_range("20120101", periods=10, freq="2D")) vals = [Timestamp("20120102"), Timestamp("20120104")] res = ser.searchsorted(vals) exp = np.array([1, 2], dtype=np.intp) tm.assert_numpy_array_equal(res, exp) def test_searchsorted_sorter(self): # GH8490 ser = Series([3, 1, 2]) res = ser.searchsorted([0, 3], sorter=np.argsort(ser)) exp = np.array([0, 2], dtype=np.intp) tm.assert_numpy_array_equal(res, exp)
Save
cmd:
run