@@ -1272,6 +1272,39 @@ the quarter end:
1272
1272
1273
1273
ts.head()
1274
1274
1275
+ .. _timeseries.oob :
1276
+
1277
+ Representing out-of-bounds spans
1278
+ --------------------------------
1279
+
1280
+ If you have data that is outside of the ``Timestamp `` bounds, see :ref: `Timestamp limitations <gotchas.timestamp-limits >`,
1281
+ then you can use a ``PeriodIndex `` and/or ``Series `` of ``Periods `` to do computations.
1282
+
1283
+ .. ipython :: python
1284
+
1285
+ span = period_range(' 1215-01-01' , ' 1381-01-01' , freq = ' D' )
1286
+ span
1287
+
1288
+ To convert from a ``int64 `` based YYYYMMDD representation.
1289
+
1290
+ .. ipython :: python
1291
+
1292
+ s = Series([20121231 , 20141130 , 99991231 ])
1293
+ s
1294
+
1295
+ def conv (x ):
1296
+ return Period(year = x // 10000 , month = x// 100 % 100 , day = x% 100 , freq = ' D' )
1297
+
1298
+ s.apply(conv)
1299
+ s.apply(conv)[2 ]
1300
+
1301
+ These can easily be converted to a ``PeriodIndex ``
1302
+
1303
+ .. ipython :: python
1304
+
1305
+ span = PeriodIndex(s.apply(conv))
1306
+ span
1307
+
1275
1308
.. _timeseries.timezone :
1276
1309
1277
1310
Time Zone Handling
@@ -1355,13 +1388,13 @@ tz-aware data to another time zone:
1355
1388
1356
1389
Be wary of conversions between libraries. For some zones ``pytz `` and ``dateutil `` have different
1357
1390
definitions of the zone. This is more of a problem for unusual timezones than for
1358
- 'standard' zones like ``US/Eastern ``.
1391
+ 'standard' zones like ``US/Eastern ``.
1359
1392
1360
- .. warning ::
1393
+ .. warning ::
1361
1394
1362
- Be aware that a timezone definition across versions of timezone libraries may not
1363
- be considered equal. This may cause problems when working with stored data that
1364
- is localized using one version and operated on with a different version.
1395
+ Be aware that a timezone definition across versions of timezone libraries may not
1396
+ be considered equal. This may cause problems when working with stored data that
1397
+ is localized using one version and operated on with a different version.
1365
1398
See :ref: `here<io.hdf5-notes> ` for how to handle such a situation.
1366
1399
1367
1400
Under the hood, all timestamps are stored in UTC. Scalar values from a
0 commit comments