/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
pandas
/
tests
/
frame
/
methods
/
/usr/local/lib64/python3.6/site-packages/pandas/tests/frame/methods
mkdir
upload
Name
Size
Mode
Actions
__pycache__/
-
0755
rm
test_align.py
10339
0644
edit
dl
rm
test_append.py
7399
0644
edit
dl
rm
test_asfreq.py
1970
0644
edit
dl
rm
test_asof.py
5767
0644
edit
dl
rm
test_assign.py
2982
0644
edit
dl
rm
test_astype.py
21027
0644
edit
dl
rm
test_at_time.py
3205
0644
edit
dl
rm
test_between_time.py
3675
0644
edit
dl
rm
test_clip.py
6028
0644
edit
dl
rm
test_combine.py
1359
0644
edit
dl
rm
test_combine_first.py
12748
0644
edit
dl
rm
test_compare.py
6158
0644
edit
dl
rm
test_count.py
1068
0644
edit
dl
rm
test_cov_corr.py
11888
0644
edit
dl
rm
test_describe.py
12492
0644
edit
dl
rm
test_diff.py
7374
0644
edit
dl
rm
test_drop.py
15662
0644
edit
dl
rm
test_droplevel.py
855
0644
edit
dl
rm
test_drop_duplicates.py
13387
0644
edit
dl
rm
test_duplicated.py
3191
0644
edit
dl
rm
test_explode.py
5294
0644
edit
dl
rm
test_filter.py
4933
0644
edit
dl
rm
test_first_and_last.py
1803
0644
edit
dl
rm
test_head_tail.py
1194
0644
edit
dl
rm
test_interpolate.py
11816
0644
edit
dl
rm
test_isin.py
7324
0644
edit
dl
rm
test_nlargest.py
6731
0644
edit
dl
rm
test_pct_change.py
3436
0644
edit
dl
rm
test_pop.py
1226
0644
edit
dl
rm
test_quantile.py
18028
0644
edit
dl
rm
test_rank.py
11377
0644
edit
dl
rm
test_reindex_like.py
1187
0644
edit
dl
rm
test_rename.py
12543
0644
edit
dl
rm
test_rename_axis.py
4074
0644
edit
dl
rm
test_replace.py
59230
0644
edit
dl
rm
test_reset_index.py
12506
0644
edit
dl
rm
test_round.py
7916
0644
edit
dl
rm
test_select_dtypes.py
12104
0644
edit
dl
rm
test_set_index.py
19571
0644
edit
dl
rm
test_shift.py
10324
0644
edit
dl
rm
test_sort_index.py
25678
0644
edit
dl
rm
test_sort_values.py
25358
0644
edit
dl
rm
test_to_dict.py
9989
0644
edit
dl
rm
test_to_period.py
984
0644
edit
dl
rm
test_to_records.py
13981
0644
edit
dl
rm
test_to_timestamp.py
4020
0644
edit
dl
rm
test_transpose.py
2426
0644
edit
dl
rm
test_truncate.py
4180
0644
edit
dl
rm
test_tz_convert.py
3415
0644
edit
dl
rm
test_tz_localize.py
666
0644
edit
dl
rm
test_update.py
4259
0644
edit
dl
rm
test_value_counts.py
2631
0644
edit
dl
rm
__init__.py
229
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/pandas/tests/frame/methods/test_pop.py
(1226B)
from pandas import DataFrame, Series import pandas._testing as tm class TestDataFramePop: def test_pop(self, float_frame): float_frame.columns.name = "baz" float_frame.pop("A") assert "A" not in float_frame float_frame["foo"] = "bar" float_frame.pop("foo") assert "foo" not in float_frame assert float_frame.columns.name == "baz" # gh-10912: inplace ops cause caching issue a = DataFrame([[1, 2, 3], [4, 5, 6]], columns=["A", "B", "C"], index=["X", "Y"]) b = a.pop("B") b += 1 # original frame expected = DataFrame([[1, 3], [4, 6]], columns=["A", "C"], index=["X", "Y"]) tm.assert_frame_equal(a, expected) # result expected = Series([2, 5], index=["X", "Y"], name="B") + 1 tm.assert_series_equal(b, expected) def test_pop_non_unique_cols(self): df = DataFrame({0: [0, 1], 1: [0, 1], 2: [4, 5]}) df.columns = ["a", "b", "a"] res = df.pop("a") assert type(res) == DataFrame assert len(res) == 2 assert len(df.columns) == 1 assert "b" in df.columns assert "a" not in df.columns assert len(df.index) == 2
Save
cmd:
run