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
``Categorical.unique`` now returns new ``Categorical`` which ``categories`` and ``codes`` that are unique, rather than returning ``np.array`` (:issue:`10508`)
574
+
575
+
- unordered category: values and categories are sorted by appearance order.
576
+
- ordered category: values are sorted by appearance order, categories keeps existing order.
577
+
578
+
.. ipython :: python
579
+
580
+
cat = pd.Categorical(['C', 'A', 'B', 'C'],
581
+
categories=['A', 'B', 'C'],
582
+
ordered=True)
583
+
cat
584
+
cat.unique()
585
+
586
+
cat = pd.Categorical(['C', 'A', 'B', 'C'],
587
+
categories=['A', 'B', 'C'])
588
+
cat
589
+
cat.unique()
590
+
591
591
592
592
.. _whatsnew_0170.api_breaking.other:
593
593
@@ -601,35 +601,17 @@ Other API Changes
601
601
- Allow passing `kwargs` to the interpolation methods (:issue:`10378`).
602
602
- Serialize metadata properties of subclasses of pandas objects (:issue:`10553`).
603
603
- Allow ``DataFrame`` with ``MultiIndex`` columns to be written to Excel (:issue:`10564`). This was changed in 0.16.2 as the read-back method could not always guarantee perfect fidelity (:issue:`9794`).
604
-
- ``Categorical.unique`` now returns new ``Categorical`` which ``categories`` and ``codes`` are unique, rather than returning ``np.array`` (:issue:`10508`)
605
-
606
-
- unordered category: values and categories are sorted by appearance order.
607
-
- ordered category: values are sorted by appearance order, categories keeps existing order.
608
-
609
-
.. ipython :: python
610
-
611
-
cat = pd.Categorical(['C', 'A', 'B', 'C'],
612
-
categories=['A', 'B', 'C'],
613
-
ordered=True)
614
-
cat
615
-
cat.unique()
616
-
617
-
cat = pd.Categorical(['C', 'A', 'B', 'C'],
618
-
categories=['A', 'B', 'C'])
619
-
cat
620
-
cat.unique()
621
-
622
604
- ``groupby`` using ``Categorical`` follows the same rule as ``Categorical.unique`` described above (:issue:`10508`)
623
605
- ``NaT``'s methods now either raise ``ValueError``, or return ``np.nan`` or ``NaT`` (:issue:`9513`)
FutureWarning: TimeSeries broadcasting along DataFrame index by default is deprecated.
695
-
Please use DataFrame.<op> to explicitly broadcast arithmetic operations along the index
675
+
In [3]: df + df.A
676
+
FutureWarning: TimeSeries broadcasting along DataFrame index by default is deprecated.
677
+
Please use DataFrame.<op> to explicitly broadcast arithmetic operations along the index
696
678
697
-
Out[3]:
679
+
Out[3]:
698
680
A B
699
-
2013-01-01 0.942870 -0.719541
700
-
2013-01-02 2.865414 1.120055
701
-
2013-01-03 -1.441177 0.166574
702
-
2013-01-04 1.719177 0.223065
703
-
2013-01-05 0.031393 -2.226989
681
+
2013-01-01 0.942870 -0.719541
682
+
2013-01-02 2.865414 1.120055
683
+
2013-01-03 -1.441177 0.166574
684
+
2013-01-04 1.719177 0.223065
685
+
2013-01-05 0.031393 -2.226989
704
686
705
-
Current
706
-
707
-
.. ipython :: python
708
-
709
-
df.add(df.A,axis='index')
687
+
Current
710
688
689
+
.. ipython :: python
711
690
691
+
df.add(df.A,axis='index')
712
692
713
693
714
694
- Remove ``table`` keyword in ``HDFStore.put/append``, in favor of using ``format=`` (:issue:`4645`)
@@ -747,7 +727,7 @@ Bug Fixes
747
727
- Bug in ``pd.Series.interpolate`` with invalid ``order`` keyword values. (:issue:`10633`)
748
728
- Bug in ``DataFrame.plot`` raises ``ValueError`` when color name is specified by multiple characters (:issue:`10387`)
749
729
- Bug in ``Index`` construction with a mixed list of tuples (:issue:`10697`)
750
-
- Bug in ``DataFrame.reset_index`` when index contains `NaT`. (:issue:`10388`)
730
+
- Bug in ``DataFrame.reset_index`` when index contains ``NaT``. (:issue:`10388`)
751
731
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
752
732
- Bug in ``BinGrouper.group_info`` where returned values are not compatible with base class (:issue:`10914`)
753
733
- Bug in clearing the cache on ``DataFrame.pop`` and a subsequent inplace op (:issue:`10912`)
@@ -758,10 +738,10 @@ Bug Fixes
758
738
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
759
739
- Bug in ``pd.rolling_*`` where ``Series.name`` would be lost in the output (:issue:`10565`)
760
740
- Bug in ``stack`` when index or columns are not unique. (:issue:`10417`)
761
-
- Bug in setting a Panel when an axis has a multi-index (:issue:`10360`)
741
+
- Bug in setting a ``Panel`` when an axis has a multi-index (:issue:`10360`)
762
742
- Bug in ``USFederalHolidayCalendar`` where ``USMemorialDay`` and ``USMartinLutherKingJr`` were incorrect (:issue:`10278` and :issue:`9760` )
763
743
- Bug in ``.sample()`` where returned object, if set, gives unnecessary ``SettingWithCopyWarning`` (:issue:`10738`)
764
-
- Bug in ``.sample()`` where weights passed as Series were not aligned along axis before being treated positionally, potentially causing problems if weight indices were not aligned with sampled object. (:issue:`10738`)
744
+
- Bug in ``.sample()`` where weights passed as ``Series`` were not aligned along axis before being treated positionally, potentially causing problems if weight indices were not aligned with sampled object. (:issue:`10738`)
765
745
766
746
767
747
@@ -832,4 +812,4 @@ Bug Fixes
832
812
- Bug in ``read_msgpack`` where encoding is not respected (:issue:`10580`)
833
813
- Bug preventing access to the first index when using ``iloc`` with a list containing the appropriate negative integer (:issue:`10547`, :issue:`10779`)
834
814
- Bug in ``TimedeltaIndex`` formatter causing error while trying to save ``DataFrame`` with ``TimedeltaIndex`` using ``to_csv`` (:issue:`10833`)
835
-
- BUG in ``DataFrame.where`` when handling Series slicing (:issue:`10218`, :issue:`9558`)
815
+
- Bug in ``DataFrame.where`` when handling Series slicing (:issue:`10218`, :issue:`9558`)
0 commit comments