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/v2.0.0.rst
+41-1
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,7 @@ Other enhancements
161
161
- Added :meth:`Index.infer_objects` analogous to :meth:`Series.infer_objects` (:issue:`50034`)
162
162
- Added ``copy`` parameter to :meth:`Series.infer_objects` and :meth:`DataFrame.infer_objects`, passing ``False`` will avoid making copies for series or columns that are already non-object or where no better dtype can be inferred (:issue:`50096`)
163
163
- :meth:`DataFrame.plot.hist` now recognizes ``xlabel`` and ``ylabel`` arguments (:issue:`49793`)
164
+
- :meth:`Series.drop_duplicates` has gained ``ignore_index`` keyword to reset index (:issue:`48304`)
164
165
- Improved error message in :func:`to_datetime` for non-ISO8601 formats, informing users about the position of the first error (:issue:`50361`)
165
166
- Improved error message when trying to align :class:`DataFrame` objects (for example, in :func:`DataFrame.compare`) to clarify that "identically labelled" refers to both index and columns (:issue:`50083`)
166
167
- Added :meth:`DatetimeIndex.as_unit` and :meth:`TimedeltaIndex.as_unit` to convert to different resolutions; supported resolutions are "s", "ms", "us", and "ns" (:issue:`50616`)
@@ -453,6 +454,37 @@ Now, the axes return an empty :class:`RangeIndex`.
453
454
pd.Series().index
454
455
pd.DataFrame().axes
455
456
457
+
.. _whatsnew_200.api_breaking.to_latex:
458
+
459
+
DataFrame to LaTeX has a new render engine
460
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
461
+
462
+
The existing :meth:`DataFrame.to_latex` has been restructured to utilise the
463
+
extended implementation previously available under :meth:`.Styler.to_latex`.
464
+
The arguments signature is similar, albeit ``col_space`` has been removed since
465
+
it is ignored by LaTeX engines. This render engine also requires ``jinja2`` as a
466
+
dependency which needs to be installed, since rendering is based upon jinja2 templates.
467
+
468
+
The pandas options below are no longer used and will be removed in future releases.
469
+
The alternative options giving similar functionality are indicated below:
470
+
471
+
- ``display.latex.escape``: replaced with ``styler.format.escape``,
472
+
- ``display.latex.longtable``: replaced with ``styler.latex.environment``,
473
+
- ``display.latex.multicolumn``, ``display.latex.multicolumn_format`` and
474
+
``display.latex.multirow``: replaced with ``styler.sparse.rows``,
475
+
``styler.sparse.columns``, ``styler.latex.multirow_align`` and
476
+
``styler.latex.multicol_align``,
477
+
- ``display.latex.repr``: replaced with ``styler.render.repr``,
478
+
- ``display.max_rows`` and ``display.max_columns``: replace with
479
+
``styler.render.max_rows``, ``styler.render.max_columns`` and
480
+
``styler.render.max_elements``.
481
+
482
+
Note that the behaviour of ``_repr_latex_`` is also changed. Previously
483
+
setting ``display.latex.repr`` would generate LaTeX only when using nbconvert for a
484
+
JupyterNotebook, and not when the user is running the notebook. Now the
485
+
``styler.render.repr`` option allows control of the specific output
486
+
within JupyterNotebooks for operations (not just on nbconvert). See :issue:`39911`.
487
+
456
488
.. _whatsnew_200.api_breaking.deps:
457
489
458
490
Increased minimum versions for dependencies
@@ -618,6 +650,7 @@ Removal of prior version deprecations/changes
618
650
- Removed deprecated :meth:`.Styler.set_na_rep` and :meth:`.Styler.set_precision` (:issue:`49397`)
- Removed deprecated ``null_counts`` argument in :meth:`DataFrame.info`. Use ``show_counts`` instead (:issue:`37999`)
@@ -792,6 +825,7 @@ Removal of prior version deprecations/changes
792
825
- Changed behavior of comparison of ``NaT`` with a ``datetime.date`` object; these now raise on inequality comparisons (:issue:`39196`)
793
826
- Enforced deprecation of silently dropping columns that raised a ``TypeError`` in :class:`Series.transform` and :class:`DataFrame.transform` when used with a list or dictionary (:issue:`43740`)
794
827
- Changed behavior of :meth:`DataFrame.apply` with list-like so that any partial failure will raise an error (:issue:`43740`)
828
+
- Changed behaviour of :meth:`DataFrame.to_latex` to now use the Styler implementation via :meth:`.Styler.to_latex` (:issue:`47970`)
795
829
- Changed behavior of :meth:`Series.__setitem__` with an integer key and a :class:`Float64Index` when the key is not present in the index; previously we treated the key as positional (behaving like ``series.iloc[key] = val``), now we treat it is a label (behaving like ``series.loc[key] = val``), consistent with :meth:`Series.__getitem__`` behavior (:issue:`33469`)
796
830
- Removed ``na_sentinel`` argument from :func:`factorize`, :meth:`.Index.factorize`, and :meth:`.ExtensionArray.factorize` (:issue:`47157`)
797
831
- Changed behavior of :meth:`Series.diff` and :meth:`DataFrame.diff` with :class:`ExtensionDtype` dtypes whose arrays do not implement ``diff``, these now raise ``TypeError`` rather than casting to numpy (:issue:`31025`)
@@ -850,7 +884,7 @@ Performance improvements
850
884
- Performance improvement for :class:`~arrays.StringArray` constructor passing a numpy array with type ``np.str_`` (:issue:`49109`)
851
885
- Performance improvement in :meth:`~arrays.IntervalArray.from_tuples` (:issue:`50620`)
852
886
- Performance improvement in :meth:`~arrays.ArrowExtensionArray.factorize` (:issue:`49177`)
853
-
- Performance improvement in :meth:`~arrays.ArrowExtensionArray.__setitem__` when key is a null slice (:issue:`50248`)
887
+
- Performance improvement in :meth:`~arrays.ArrowExtensionArray.__setitem__` (:issue:`50248`, :issue:`50632`)
854
888
- Performance improvement in :class:`~arrays.ArrowExtensionArray` comparison methods when array contains NA (:issue:`50524`)
855
889
- Performance improvement in :meth:`~arrays.ArrowExtensionArray.to_numpy` (:issue:`49973`)
856
890
- Performance improvement when parsing strings to :class:`BooleanDtype` (:issue:`50613`)
@@ -868,11 +902,15 @@ Performance improvements
868
902
- Performance improvement in :func:`merge` when not merging on the index - the new index will now be :class:`RangeIndex` instead of :class:`Int64Index` (:issue:`49478`)
869
903
- Performance improvement in :meth:`DataFrame.to_dict` and :meth:`Series.to_dict` when using any non-object dtypes (:issue:`46470`)
870
904
- Performance improvement in :func:`read_html` when there are multiple tables (:issue:`49929`)
905
+
- Performance improvement in :class:`Period` constructor when constructing from a string or integer (:issue:`38312`)
871
906
- Performance improvement in :func:`to_datetime` when using ``'%Y%m%d'`` format (:issue:`17410`)
872
907
- Performance improvement in :func:`to_datetime` when format is given or can be inferred (:issue:`50465`)
908
+
- Performance improvement in :meth:`Series.median` for nullable dtypes (:issue:`50838`)
873
909
- Performance improvement in :func:`read_csv` when passing :func:`to_datetime` lambda-function to ``date_parser`` and inputs have mixed timezone offsetes (:issue:`35296`)
910
+
- Performance improvement in :func:`isna` and :func:`isnull` (:issue:`50658`)
874
911
- Performance improvement in :meth:`.SeriesGroupBy.value_counts` with categorical dtype (:issue:`46202`)
875
912
- Fixed a reference leak in :func:`read_hdf` (:issue:`37441`)
913
+
- Fixed a memory leak in :meth:`DataFrame.to_json` and :meth:`Series.to_json` when serializing datetimes and timedeltas (:issue:`40443`)
- Bug in :meth:`DataFrame.to_string` ignoring float formatter for extension arrays (:issue:`39336`)
1021
1059
- Fixed memory leak which stemmed from the initialization of the internal JSON module (:issue:`49222`)
1022
1060
- Fixed issue where :func:`json_normalize` would incorrectly remove leading characters from column names that matched the ``sep`` argument (:issue:`49861`)
1061
+
- Bug in :func:`read_csv` unnecessarily overflowing for extension array dtype when containing ``NA`` (:issue:`32134`)
1023
1062
- Bug in :meth:`DataFrame.to_dict` not converting ``NA`` to ``None`` (:issue:`50795`)
1024
1063
- Bug in :meth:`DataFrame.to_json` where it would segfault when failing to encode a string (:issue:`50307`)
1064
+
- Bug in :func:`read_xml` where file-like objects failed when iterparse is used (:issue:`50641`)
0 commit comments