We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81f76f2 commit 22d9ad5Copy full SHA for 22d9ad5
pandas/tseries/tests/test_period.py
@@ -6,6 +6,9 @@
6
7
"""
8
9
+import pickle
10
+import os
11
+
12
from datetime import datetime, date, timedelta
13
14
from numpy.ma.testutils import assert_equal
@@ -2537,6 +2540,16 @@ def test_searchsorted(self):
2537
2540
ValueError, 'Different period frequency: H',
2538
2541
lambda: pidx.searchsorted(pd.Period('2014-01-01', freq='H')))
2539
2542
2543
+ def test_round_trip_pickle(self):
2544
2545
+ p = Period('2000Q1')
2546
+ pickle_path = os.path.join(tm.get_data_path(),
2547
+ 'period.pickle')
2548
2549
+ with open(pickle_path, 'wb') as f: pickle.dump(p, f)
2550
2551
+ self.assertEqual(p, pd.read_pickle(pickle_path))
2552
2553
def _permute(obj):
2554
return obj.take(np.random.permutation(len(obj)))
2555
0 commit comments