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
- [x] closes#11655 - [x] tests added / passed - [x] passes ``git
diff upstream/master | flake8 --diff`` - [x] whatsnew entry
[Notebook comparing `DataFrame._html_repr_` to `DataFrame.style`](http
s://gist.github.com/609c398f814b4a505bf4f406670e457e) I think we're
identical for non-truncated DataFrames. That' has not been implemented
in `Styler` yet. Along the way I noticed two other things that
ended up needing fixing. 1. DataFrame.columns.names were not
displayed 2. CSS classes weren't being assigned correctly to row
labels. The fixes ended up being pretty intertwined, so I've put
them in a single PR. Unfortunately, the commits are a bit jumbled as
well :/
Author: Tom Augspurger <[email protected]>
Closes#13775 from TomAugspurger/style-sparse-mi-2 and squashes the following commits:
7c03a72 [Tom Augspurger] ENH: DataFrame.style column names
ecba615 [Tom Augspurger] ENH: MultiIndex Structure for DataFrame.style
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.19.0.txt
+3-1
Original file line number
Diff line number
Diff line change
@@ -373,6 +373,8 @@ Other enhancements
373
373
- ``Series.append`` now supports the ``ignore_index`` option (:issue:`13677`)
374
374
- ``.to_stata()`` and ``StataWriter`` can now write variable labels to Stata dta files using a dictionary to make column names to labels (:issue:`13535`, :issue:`13536`)
375
375
- ``.to_stata()`` and ``StataWriter`` will automatically convert ``datetime64[ns]`` columns to Stata format ``%tc``, rather than raising a ``ValueError`` (:issue:`12259`)
376
+
- ``DataFrame.style`` will now render sparsified MultiIndexes (:issue:`11655`)
377
+
- ``DataFrame.style`` will now show column level names (e.g. ``DataFrame.columns.names``) (:issue:`13775`)
376
378
- ``DataFrame`` has gained support to re-order the columns based on the values
377
379
in a row using ``df.sort_values(by='...', axis=1)`` (:issue:`10806`)
378
380
@@ -884,10 +886,10 @@ Bug Fixes
884
886
- Bug in ``groupby`` with ``as_index=False`` returns all NaN's when grouping on multiple columns including a categorical one (:issue:`13204`)
885
887
- Bug in ``df.groupby(...)[...]`` where getitem with ``Int64Index`` raised an error (:issue:`13731`)
886
888
889
+
- Bug in the CSS classes assigned to ``DataFrame.style`` for index names. Previously they were assigned ``"col_heading level<n> col<c>"`` where ``n`` was the number of levels + 1. Now they are assigned ``"index_name level<n>"``, where ``n`` is the correct level for that MultiIndex.
887
890
- Bug where ``pd.read_gbq()`` could throw ``ImportError: No module named discovery`` as a result of a naming conflict with another python package called apiclient (:issue:`13454`)
888
891
- Bug in ``Index.union`` returns an incorrect result with a named empty index (:issue:`13432`)
889
892
- Bugs in ``Index.difference`` and ``DataFrame.join`` raise in Python3 when using mixed-integer indexes (:issue:`13432`, :issue:`12814`)
890
-
891
893
- Bug in ``.to_excel()`` when DataFrame contains a MultiIndex which contains a label with a NaN value (:issue:`13511`)
892
894
- Bug in ``pd.read_csv`` in Python 2.x with non-UTF8 encoded, multi-character separated data (:issue:`3404`)
893
895
- Bug in ``Index`` raises ``KeyError`` displaying incorrect column when column is not in the df and columns contains duplicate values (:issue:`13822`)
0 commit comments