@@ -1270,6 +1270,36 @@ frequencies. We will refer to these aliases as *offset aliases*.
1270
1270
"U, us", "microseconds"
1271
1271
"N", "nanoseconds"
1272
1272
1273
+ .. note ::
1274
+
1275
+ When using the offset aliases above, it should be noted that functions
1276
+ such as :func: `date_range `, :func: `bdate_range `, will only return
1277
+ timestamps that are in the interval defined by ``start_date `` and
1278
+ ``end_date ``. If the ``start_date `` does not correspond to the frequency,
1279
+ the returned timestamps will start at the next valid timestamp, same for
1280
+ ``end_date ``, the returned timestamps will stop at the previous valid
1281
+ timestamp.
1282
+
1283
+ For example, for the offset ``MS ``, if the ``start_date `` is not the first
1284
+ of the month, the returned timestamps will start with the first day of the
1285
+ next month. If ``end_date `` is not the first day of a month, the last
1286
+ returned timestamp will be the first day of the corresponding month.
1287
+
1288
+ .. ipython :: python
1289
+
1290
+ dates_lst_1 = pd.date_range(" 2020-01-06" , " 2020-04-03" , freq = " MS" )
1291
+ dates_lst_1
1292
+
1293
+ dates_lst_2 = pd.date_range(" 2020-01-01" , " 2020-04-01" , freq = " MS" )
1294
+ dates_lst_2
1295
+
1296
+ We can see in the above example :func: `date_range ` and
1297
+ :func: `bdate_range ` will only return the valid timestamps between the
1298
+ ``start_date `` and ``end_date ``. If these are not valid timestamps for the
1299
+ given frequency it will roll to the next value for ``start_date ``
1300
+ (respectively previous for the ``end_date ``)
1301
+
1302
+
1273
1303
Combining aliases
1274
1304
~~~~~~~~~~~~~~~~~
1275
1305
0 commit comments