/
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_to_period.py
(984B)
import numpy as np import pytest from pandas import DataFrame, date_range, period_range import pandas._testing as tm class TestToPeriod: def test_frame_to_period(self): K = 5 dr = date_range("1/1/2000", "1/1/2001") pr = period_range("1/1/2000", "1/1/2001") df = DataFrame(np.random.randn(len(dr), K), index=dr) df["mix"] = "a" pts = df.to_period() exp = df.copy() exp.index = pr tm.assert_frame_equal(pts, exp) pts = df.to_period("M") tm.assert_index_equal(pts.index, exp.index.asfreq("M")) df = df.T pts = df.to_period(axis=1) exp = df.copy() exp.columns = pr tm.assert_frame_equal(pts, exp) pts = df.to_period("M", axis=1) tm.assert_index_equal(pts.columns, exp.columns.asfreq("M")) msg = "No axis named 2 for object type DataFrame" with pytest.raises(ValueError, match=msg): df.to_period(axis=2)
Save
cmd:
run