You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.21.0.txt
+54-1
Original file line number
Diff line number
Diff line change
@@ -218,7 +218,7 @@ Furthermore this will now correctly box the results of iteration for :func:`Data
218
218
.. ipython:: ipython
219
219
220
220
d = {'a':[1], 'b':['b']}
221
-
df = pd,DataFrame(d)
221
+
df = pd.DataFrame(d)
222
222
223
223
Previously:
224
224
@@ -358,6 +358,59 @@ Previously, :func:`to_datetime` did not localize datetime ``Series`` data when `
358
358
359
359
Additionally, DataFrames with datetime columns that were parsed by :func:`read_sql_table` and :func:`read_sql_query` will also be localized to UTC only if the original SQL columns were timezone aware datetime columns.
In previous versions, there were some inconsistencies between the various range functions: func:`date_range`, func:`bdate_range`, func:`cdate_range`, func:`period_range`, func:`timedelta_range`, and func:`interval_range`. (:issue:`17471`).
367
+
368
+
One of the inconsistent behaviors occurred when the ``start``, ``end`` and ``period`` parameters were all specified, potentially leading to ambiguous ranges. When all three parameters were passed, ``interval_range`` ignored the ``period`` parameter, ``period_range`` ignored the ``end`` parameter, and the other range functions raised. To promote consistency among the range functions, and avoid potentially ambiguous ranges, ``interval_range`` and ``period_range`` will now raise when all three parameters are passed.
369
+
370
+
Previous Behavior:
371
+
372
+
.. code-block:: ipython
373
+
374
+
In [2]: pd.interval_range(start=0, end=4, periods=6)
375
+
Out[2]:
376
+
IntervalIndex([(0, 1], (1, 2], (2, 3]]
377
+
closed='right',
378
+
dtype='interval[int64]')
379
+
380
+
In [3]: pd.period_range(start='2017Q1', end='2017Q4', periods=6, freq='Q')
ValueError: Of the three parameters: start, end, and periods, exactly two must be specified
394
+
395
+
Additionally, the endpoint parameter ``end`` was not included in the intervals produced by ``interval_range``. However, all other range functions include ``end`` in their output. To promote consistency among the range functions, ``interval_range`` will now include ``end`` as the right endpoint of the final interval, except if ``freq`` is specified in a way which skips ``end``.
0 commit comments