diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index c9c76f307d93f..26e9b2fdb07a6 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -127,7 +127,7 @@ to build the documentation locally before pushing your changes. .. _contributing.dev_c: -Installing a C Compiler +Installing a C compiler ~~~~~~~~~~~~~~~~~~~~~~~ Pandas uses C extensions (mostly written using Cython) to speed up certain @@ -155,7 +155,7 @@ Let us know if you have any difficulties by opening an issue or reaching out on .. _contributing.dev_python: -Creating a Python Environment +Creating a Python environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now that you have a C compiler, create an isolated pandas development @@ -209,7 +209,7 @@ See the full conda docs `here `__. .. _contributing.pip: -Creating a Python Environment (pip) +Creating a Python environment (pip) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you aren't using conda for your development environment, follow these instructions. @@ -605,7 +605,7 @@ and run ``flake8`` on them, one after the other. .. _contributing.import-formatting: -Import Formatting +Import formatting ~~~~~~~~~~~~~~~~~ *pandas* uses `isort `__ to standardise import formatting across the codebase. @@ -651,7 +651,7 @@ The `--recursive` flag can be passed to sort all files in a directory. You can then verify the changes look ok, then git :ref:`commit ` and :ref:`push `. -Backwards Compatibility +Backwards compatibility ~~~~~~~~~~~~~~~~~~~~~~~ Please try to maintain backward compatibility. *pandas* has lots of users with lots of @@ -699,7 +699,7 @@ See :ref:`contributing.warnings` for more. .. _contributing.ci: -Testing With Continuous Integration +Testing with continuous integration ----------------------------------- The *pandas* test suite will run automatically on `Travis-CI `__ and @@ -930,7 +930,7 @@ options or subtle interactions to test (or think of!) all of them. .. _contributing.warnings: -Testing Warnings +Testing warnings ~~~~~~~~~~~~~~~~ By default, one of pandas CI workers will fail if any unhandled warnings are emitted. diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index f7e2b42a1ccbd..62216f168af3c 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -929,7 +929,7 @@ plot will be generated automatically when building the documentation. .. _docstring.sharing: -Sharing Docstrings +Sharing docstrings ------------------ Pandas has a system for sharing docstrings, with slight variations, between diff --git a/doc/source/development/extending.rst b/doc/source/development/extending.rst index 8bee0452c2207..363ec10d58bb6 100644 --- a/doc/source/development/extending.rst +++ b/doc/source/development/extending.rst @@ -3,7 +3,7 @@ {{ header }} **************** -Extending Pandas +Extending pandas **************** While pandas provides a rich set of methods, containers, and data types, your @@ -12,7 +12,7 @@ pandas. .. _extending.register-accessors: -Registering Custom Accessors +Registering custom accessors ---------------------------- Libraries can use the decorators @@ -70,7 +70,7 @@ applies only to certain dtypes. .. _extending.extension-types: -Extension Types +Extension types --------------- .. versionadded:: 0.23.0 @@ -210,7 +210,7 @@ will .. _extending.extension.testing: -Testing Extension Arrays +Testing extension arrays ^^^^^^^^^^^^^^^^^^^^^^^^ We provide a test suite for ensuring that your extension arrays satisfy the expected @@ -238,7 +238,7 @@ for a list of all the tests available. .. _extending.subclassing-pandas: -Subclassing pandas Data Structures +Subclassing pandas data structures ---------------------------------- .. warning:: There are some easier alternatives before considering subclassing ``pandas`` data structures. @@ -260,7 +260,7 @@ This section describes how to subclass ``pandas`` data structures to meet more s You can find a nice example in `geopandas `_ project. -Override Constructor Properties +Override constructor properties ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Each data structure has several *constructor properties* for returning a new @@ -348,7 +348,7 @@ Below example shows how to define ``SubclassedSeries`` and ``SubclassedDataFrame >>> type(sliced2) -Define Original Properties +Define original properties ^^^^^^^^^^^^^^^^^^^^^^^^^^ To let original data structures have additional properties, you should let ``pandas`` know what properties are added. ``pandas`` maps unknown properties to data names overriding ``__getattribute__``. Defining original properties can be done in one of 2 ways: diff --git a/doc/source/development/internals.rst b/doc/source/development/internals.rst index 9c434928c214e..748caae295460 100644 --- a/doc/source/development/internals.rst +++ b/doc/source/development/internals.rst @@ -102,7 +102,7 @@ So, for example, ``Series[category]._values`` is a ``Categorical``, while .. _ref-subclassing-pandas: -Subclassing pandas Data Structures +Subclassing pandas data structures ---------------------------------- This section has been moved to :ref:`extending.subclassing-pandas`. diff --git a/doc/source/ecosystem.rst b/doc/source/ecosystem.rst index b1a5430752558..b76dd3e0ff8e6 100644 --- a/doc/source/ecosystem.rst +++ b/doc/source/ecosystem.rst @@ -3,7 +3,7 @@ {{ header }} **************** -pandas Ecosystem +Pandas ecosystem **************** Increasingly, packages are being built on top of pandas to address specific needs @@ -26,7 +26,7 @@ substantial projects that you feel should be on this list, please let us know. .. _ecosystem.stats: -Statistics and Machine Learning +Statistics and machine learning ------------------------------- `Statsmodels `__ @@ -243,7 +243,7 @@ you can obtain for free on the FRED website. .. _ecosystem.domain: -Domain Specific +Domain specific --------------- `Geopandas `__ @@ -332,7 +332,7 @@ and check that they're *actually* true. .. _ecosystem.extensions: -Extension Data Types +Extension data types -------------------- Pandas provides an interface for defining diff --git a/doc/source/getting_started/10min.rst b/doc/source/getting_started/10min.rst index 8bb188419cb59..68ba777ec2c2a 100644 --- a/doc/source/getting_started/10min.rst +++ b/doc/source/getting_started/10min.rst @@ -3,7 +3,7 @@ {{ header }} ******************** -10 Minutes to pandas +10 minutes to pandas ******************** This is a short introduction to pandas, geared mainly for new users. @@ -16,7 +16,7 @@ Customarily, we import as follows: import numpy as np import pandas as pd -Object Creation +Object creation --------------- See the :ref:`Data Structure Intro section `. @@ -83,7 +83,7 @@ As you can see, the columns ``A``, ``B``, ``C``, and ``D`` are automatically tab completed. ``E`` is there as well; the rest of the attributes have been truncated for brevity. -Viewing Data +Viewing data ------------ See the :ref:`Basics section `. @@ -183,7 +183,7 @@ Selecting via ``[]``, which slices the rows. df[0:3] df['20130102':'20130104'] -Selection by Label +Selection by label ~~~~~~~~~~~~~~~~~~ See more in :ref:`Selection by Label `. @@ -224,7 +224,7 @@ For getting fast access to a scalar (equivalent to the prior method): df.at[dates[0], 'A'] -Selection by Position +Selection by position ~~~~~~~~~~~~~~~~~~~~~ See more in :ref:`Selection by Position `. @@ -271,7 +271,7 @@ For getting fast access to a scalar (equivalent to the prior method): df.iat[1, 1] -Boolean Indexing +Boolean indexing ~~~~~~~~~~~~~~~~ Using a single column's values to select data. @@ -340,7 +340,7 @@ A ``where`` operation with setting. df2 -Missing Data +Missing data ------------ pandas primarily uses the value ``np.nan`` to represent missing data. It is by @@ -580,7 +580,7 @@ With a "stacked" DataFrame or Series (having a ``MultiIndex`` as the stacked.unstack(1) stacked.unstack(0) -Pivot Tables +Pivot tables ~~~~~~~~~~~~ See the section on :ref:`Pivot Tables `. @@ -600,7 +600,7 @@ We can produce pivot tables from this data very easily: pd.pivot_table(df, values='D', index=['A', 'B'], columns=['C']) -Time Series +Time series ----------- pandas has simple, powerful, and efficient functionality for performing @@ -735,7 +735,7 @@ of the columns with labels: @savefig frame_plot_basic.png plt.legend(loc='best') -Getting Data In/Out +Getting data in/out ------------------- CSV diff --git a/doc/source/getting_started/basics.rst b/doc/source/getting_started/basics.rst index 5ec0094de0a91..3ba79210a43ee 100644 --- a/doc/source/getting_started/basics.rst +++ b/doc/source/getting_started/basics.rst @@ -3,7 +3,7 @@ {{ header }} ============================== - Essential Basic Functionality + Essential basic functionality ============================== Here we discuss a lot of the essential functionality common to the pandas data @@ -19,7 +19,7 @@ the previous section: .. _basics.head_tail: -Head and Tail +Head and tail ------------- To view a small sample of a Series or DataFrame object, use the @@ -34,7 +34,7 @@ of elements to display is five, but you may pass a custom number. .. _basics.attrs: -Attributes and Underlying Data +Attributes and underlying data ------------------------------ pandas objects have a number of attributes enabling you to access the metadata @@ -286,7 +286,7 @@ using ``fillna`` if you wish). .. _basics.compare: -Flexible Comparisons +Flexible comparisons ~~~~~~~~~~~~~~~~~~~~ Series and DataFrame have the binary comparison methods ``eq``, ``ne``, ``lt``, ``gt``, @@ -304,7 +304,7 @@ indexing operations, see the section on :ref:`Boolean indexing .. _basics.reductions: -Boolean Reductions +Boolean reductions ~~~~~~~~~~~~~~~~~~ You can apply the reductions: :attr:`~DataFrame.empty`, :meth:`~DataFrame.any`, @@ -468,7 +468,7 @@ which we illustrate: df2 df1.combine_first(df2) -General DataFrame Combine +General DataFrame combine ~~~~~~~~~~~~~~~~~~~~~~~~~ The :meth:`~DataFrame.combine_first` method above calls the more general @@ -643,7 +643,7 @@ there for details about accepted inputs. .. _basics.idxmin: -Index of Min/Max Values +Index of min/max values ~~~~~~~~~~~~~~~~~~~~~~~ The :meth:`~DataFrame.idxmin` and :meth:`~DataFrame.idxmax` functions on Series @@ -677,7 +677,7 @@ matching index: .. _basics.discretization: -Value counts (histogramming) / Mode +Value counts (histogramming) / mode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The :meth:`~Series.value_counts` Series method and top-level function computes a histogram @@ -752,7 +752,7 @@ on an entire ``DataFrame`` or ``Series``, row- or column-wise, or elementwise. .. _basics.pipe: -Tablewise Function Application +Tablewise function application ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``DataFrames`` and ``Series`` can of course just be passed into functions. @@ -806,7 +806,7 @@ We encourage you to view the source code of :meth:`~DataFrame.pipe`. .. _R: https://www.r-project.org -Row or Column-wise Function Application +Row or column-wise function application ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Arbitrary functions can be applied along the axes of a DataFrame @@ -987,7 +987,7 @@ not noted for a particular column will be ``NaN``: .. _basics.aggregation.mixed_dtypes: -Mixed Dtypes +Mixed dtypes ++++++++++++ When presented with mixed dtypes that cannot aggregate, ``.agg`` will only take the valid @@ -1106,7 +1106,7 @@ selective transforms. .. _basics.elementwise: -Applying Elementwise Functions +Applying elementwise functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since not all functions can be vectorized (accept NumPy arrays and return @@ -1726,7 +1726,7 @@ sorting by column values, and sorting by a combination of both. .. _basics.sort_index: -By Index +By index ~~~~~~~~ The :meth:`Series.sort_index` and :meth:`DataFrame.sort_index` methods are @@ -1753,7 +1753,7 @@ used to sort a pandas object by its index levels. .. _basics.sort_values: -By Values +By values ~~~~~~~~~ The :meth:`Series.sort_values` method is used to sort a `Series` by its values. The @@ -1785,7 +1785,7 @@ argument: .. _basics.sort_indexes_and_values: -By Indexes and Values +By indexes and values ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.23.0 diff --git a/doc/source/getting_started/comparison/comparison_with_r.rst b/doc/source/getting_started/comparison/comparison_with_r.rst index 2957430666b8a..444e886bc951d 100644 --- a/doc/source/getting_started/comparison/comparison_with_r.rst +++ b/doc/source/getting_started/comparison/comparison_with_r.rst @@ -26,7 +26,7 @@ use HDF5 files, see :ref:`io.external_compatibility` for an example. -Quick Reference +Quick reference --------------- We'll start off with a quick reference guide pairing some common R @@ -35,7 +35,7 @@ operations using `dplyr pandas equivalents. -Querying, Filtering, Sampling +Querying, filtering, sampling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =========================================== =========================================== @@ -85,7 +85,7 @@ R pandas =========================================== =========================================== -Grouping and Summarizing +Grouping and summarizing ~~~~~~~~~~~~~~~~~~~~~~~~ ============================================== =========================================== diff --git a/doc/source/getting_started/comparison/comparison_with_sas.rst b/doc/source/getting_started/comparison/comparison_with_sas.rst index cbedeec737ec0..69bb700c97b15 100644 --- a/doc/source/getting_started/comparison/comparison_with_sas.rst +++ b/doc/source/getting_started/comparison/comparison_with_sas.rst @@ -31,10 +31,10 @@ As is customary, we import pandas and NumPy as follows: proc print data=df(obs=5); run; -Data Structures +Data structures --------------- -General Terminology Translation +General terminology translation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: @@ -78,10 +78,10 @@ see the :ref:`indexing documentation` for much more on how to use an ``Index`` effectively. -Data Input / Output +Data input / output ------------------- -Constructing a DataFrame from Values +Constructing a DataFrame from values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A SAS data set can be built from specified values by @@ -110,7 +110,7 @@ and the values are the data. df -Reading External Data +Reading external data ~~~~~~~~~~~~~~~~~~~~~ Like SAS, pandas provides utilities for reading in data from @@ -151,7 +151,7 @@ In addition to text/csv, pandas supports a variety of other data formats such as Excel, HDF5, and SQL databases. These are all read via a ``pd.read_*`` function. See the :ref:`IO documentation` for more details. -Exporting Data +Exporting data ~~~~~~~~~~~~~~ The inverse of ``PROC IMPORT`` in SAS is ``PROC EXPORT`` @@ -169,10 +169,10 @@ and other data formats follow a similar api. tips.to_csv('tips2.csv') -Data Operations +Data operations --------------- -Operations on Columns +Operations on columns ~~~~~~~~~~~~~~~~~~~~~ In the ``DATA`` step, arbitrary math expressions can @@ -228,7 +228,7 @@ DataFrames can be filtered in multiple ways; the most intuitive of which is usin tips[tips['total_bill'] > 10].head() -If/Then Logic +If/then logic ~~~~~~~~~~~~~ In SAS, if/then logic can be used to create new columns. @@ -256,7 +256,7 @@ the ``where`` method from ``numpy``. tips = tips.drop('bucket', axis=1) -Date Functionality +Date functionality ~~~~~~~~~~~~~~~~~~ SAS provides a variety of functions to do operations on @@ -301,7 +301,7 @@ see the :ref:`timeseries documentation` for more details. tips = tips.drop(['date1', 'date2', 'date1_year', 'date2_month', 'date1_next', 'months_between'], axis=1) -Selection of Columns +Selection of columns ~~~~~~~~~~~~~~~~~~~~ SAS provides keywords in the ``DATA`` step to select, @@ -338,7 +338,7 @@ The same operations are expressed in pandas below. tips.rename(columns={'total_bill': 'total_bill_2'}).head() -Sorting by Values +Sorting by values ~~~~~~~~~~~~~~~~~ Sorting in SAS is accomplished via ``PROC SORT`` @@ -358,7 +358,7 @@ takes a list of columns to sort by. tips.head() -String Processing +String processing ----------------- Length @@ -466,7 +466,7 @@ approaches, but this just shows a simple approach. firstlast -Upcase, Lowcase, and Propcase +Upcase, lowcase, and propcase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The SAS `UPCASE `__ @@ -555,7 +555,7 @@ types are accomplished via the ``how`` keyword. outer_join -Missing Data +Missing data ------------ Like SAS, pandas has a representation for missing data - which is the @@ -671,7 +671,7 @@ operation. tips.head() -By Group Processing +By group processing ~~~~~~~~~~~~~~~~~~~ In addition to aggregation, pandas ``groupby`` can be used to @@ -701,7 +701,7 @@ In pandas this would be written as: Other Considerations -------------------- -Disk vs Memory +Disk vs memory ~~~~~~~~~~~~~~ pandas operates exclusively in memory, where a SAS data set exists on disk. @@ -713,7 +713,7 @@ If out of core processing is needed, one possibility is the library (currently in development) which provides a subset of pandas functionality for an on-disk ``DataFrame`` -Data Interop +Data interop ~~~~~~~~~~~~ pandas provides a :func:`read_sas` method that can read SAS data saved in diff --git a/doc/source/getting_started/comparison/comparison_with_stata.rst b/doc/source/getting_started/comparison/comparison_with_stata.rst index c354ed7872cb4..db687386329bb 100644 --- a/doc/source/getting_started/comparison/comparison_with_stata.rst +++ b/doc/source/getting_started/comparison/comparison_with_stata.rst @@ -31,10 +31,10 @@ libraries as ``pd`` and ``np``, respectively, for the rest of the document. list in 1/5 -Data Structures +Data structures --------------- -General Terminology Translation +General terminology translation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: @@ -78,10 +78,10 @@ see the :ref:`indexing documentation` for much more on how to use an ``Index`` effectively. -Data Input / Output +Data input / output ------------------- -Constructing a DataFrame from Values +Constructing a DataFrame from values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A Stata data set can be built from specified values by @@ -107,7 +107,7 @@ and the values are the data. df -Reading External Data +Reading external data ~~~~~~~~~~~~~~~~~~~~~ Like Stata, pandas provides utilities for reading in data from @@ -155,7 +155,7 @@ such as Excel, SAS, HDF5, Parquet, and SQL databases. These are all read via a function. See the :ref:`IO documentation` for more details. -Exporting Data +Exporting data ~~~~~~~~~~~~~~ The inverse of ``import delimited`` in Stata is ``export delimited`` @@ -177,10 +177,10 @@ Pandas can also export to Stata file format with the :meth:`DataFrame.to_stata` tips.to_stata('tips2.dta') -Data Operations +Data operations --------------- -Operations on Columns +Operations on columns ~~~~~~~~~~~~~~~~~~~~~ In Stata, arbitrary math expressions can be used with the ``generate`` and @@ -222,7 +222,7 @@ DataFrames can be filtered in multiple ways; the most intuitive of which is usin tips[tips['total_bill'] > 10].head() -If/Then Logic +If/then logic ~~~~~~~~~~~~~ In Stata, an ``if`` clause can also be used to create new columns. @@ -245,7 +245,7 @@ the ``where`` method from ``numpy``. tips = tips.drop('bucket', axis=1) -Date Functionality +Date functionality ~~~~~~~~~~~~~~~~~~ Stata provides a variety of functions to do operations on @@ -290,7 +290,7 @@ see the :ref:`timeseries documentation` for more details. tips = tips.drop(['date1', 'date2', 'date1_year', 'date2_month', 'date1_next', 'months_between'], axis=1) -Selection of Columns +Selection of columns ~~~~~~~~~~~~~~~~~~~~ Stata provides keywords to select, drop, and rename columns. @@ -319,7 +319,7 @@ to a variable. tips.rename(columns={'total_bill': 'total_bill_2'}).head() -Sorting by Values +Sorting by values ~~~~~~~~~~~~~~~~~ Sorting in Stata is accomplished via ``sort`` @@ -337,10 +337,10 @@ takes a list of columns to sort by. tips.head() -String Processing +String processing ----------------- -Finding Length of String +Finding length of string ~~~~~~~~~~~~~~~~~~~~~~~~ Stata determines the length of a character string with the :func:`strlen` and @@ -361,7 +361,7 @@ Use ``len`` and ``rstrip`` to exclude trailing blanks. tips['time'].str.rstrip().str.len().head() -Finding Position of Substring +Finding position of substring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stata determines the position of a character in a string with the :func:`strpos` function. @@ -383,7 +383,7 @@ the function will return -1 if it fails to find the substring. tips['sex'].str.find("ale").head() -Extracting Substring by Position +Extracting substring by position ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stata extracts a substring from a string based on its position with the :func:`substr` function. @@ -401,7 +401,7 @@ indexes are zero-based. tips['sex'].str[0:1].head() -Extracting nth Word +Extracting nth word ~~~~~~~~~~~~~~~~~~~ The Stata :func:`word` function returns the nth word from a string. @@ -431,7 +431,7 @@ approaches, but this just shows a simple approach. firstlast -Changing Case +Changing case ~~~~~~~~~~~~~ The Stata :func:`strupper`, :func:`strlower`, :func:`strproper`, @@ -547,7 +547,7 @@ types are accomplished via the ``how`` keyword. outer_join -Missing Data +Missing data ------------ Like Stata, pandas has a representation for missing data -- the @@ -645,7 +645,7 @@ operation. tips.head() -By Group Processing +By group processing ~~~~~~~~~~~~~~~~~~~ In addition to aggregation, pandas ``groupby`` can be used to @@ -664,10 +664,10 @@ In pandas this would be written as: tips.groupby(['sex', 'smoker']).first() -Other Considerations +Other considerations -------------------- -Disk vs Memory +Disk vs memory ~~~~~~~~~~~~~~ Pandas and Stata both operate exclusively in memory. This means that the size of diff --git a/doc/source/getting_started/dsintro.rst b/doc/source/getting_started/dsintro.rst index 1abca7ac393dd..914c55115567a 100644 --- a/doc/source/getting_started/dsintro.rst +++ b/doc/source/getting_started/dsintro.rst @@ -3,7 +3,7 @@ {{ header }} ************************ -Intro to Data Structures +Intro to data structures ************************ We'll start with a quick, non-comprehensive overview of the fundamental data @@ -399,7 +399,7 @@ The result will be a DataFrame with the same index as the input Series, and with one column whose name is the original name of the Series (only if no other column name provided). -**Missing Data** +**Missing data** Much more will be said on this topic in the :ref:`Missing data ` section. To construct a DataFrame with missing data, we use ``np.nan`` to @@ -407,7 +407,7 @@ represent missing values. Alternatively, you may pass a ``numpy.MaskedArray`` as the data argument to the DataFrame constructor, and its masked entries will be considered missing. -Alternate Constructors +Alternate constructors ~~~~~~~~~~~~~~~~~~~~~~ .. _basics.dataframe.from_dict: @@ -498,7 +498,7 @@ available to insert at a particular location in the columns: .. _dsintro.chained_assignment: -Assigning New Columns in Method Chains +Assigning new columns in method chains ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Inspired by `dplyr's @@ -614,7 +614,7 @@ To write code compatible with all versions of Python, split the assignment in tw -Indexing / Selection +Indexing / selection ~~~~~~~~~~~~~~~~~~~~ The basics of indexing are as follows: diff --git a/doc/source/getting_started/overview.rst b/doc/source/getting_started/overview.rst index b531f686951fc..ec76c60f24257 100644 --- a/doc/source/getting_started/overview.rst +++ b/doc/source/getting_started/overview.rst @@ -81,7 +81,7 @@ Some other notes - pandas has been used extensively in production in financial applications. -Data Structures +Data structures --------------- .. csv-table:: @@ -131,7 +131,7 @@ changed, but, for example, columns can be inserted into a DataFrame. However, the vast majority of methods produce new objects and leave the input data untouched. In general we like to **favor immutability** where sensible. -Getting Support +Getting support --------------- The first stop for pandas issues and ideas is the `Github Issue Tracker @@ -152,7 +152,7 @@ pandas is a `NumFOCUS `__ sponso This will help ensure the success of development of pandas as a world-class open-source project, and makes it possible to `donate `__ to the project. -Project Governance +Project governance ------------------ The governance process that pandas project has used informally since its inception in 2008 is formalized in `Project Governance documents `__. @@ -160,13 +160,13 @@ The documents clarify how decisions are made and how the various elements of our Wes McKinney is the Benevolent Dictator for Life (BDFL). -Development Team +Development team ----------------- The list of the Core Team members and more detailed information can be found on the `people’s page `__ of the governance repo. -Institutional Partners +Institutional partners ---------------------- The information about current institutional partners can be found on `pandas website page `__. diff --git a/doc/source/getting_started/tutorials.rst b/doc/source/getting_started/tutorials.rst index 8e23c643280c1..212f3636d0a98 100644 --- a/doc/source/getting_started/tutorials.rst +++ b/doc/source/getting_started/tutorials.rst @@ -8,7 +8,7 @@ Tutorials This is a guide to many pandas tutorials, geared mainly for new users. -Internal Guides +Internal guides =============== pandas' own :ref:`10 Minutes to pandas<10min>`. @@ -17,7 +17,7 @@ More complex recipes are in the :ref:`Cookbook`. A handy pandas `cheat sheet `_. -Community Guides +Community guides ================ pandas Cookbook by Julia Evans @@ -74,7 +74,7 @@ Excel charts with pandas, vincent and xlsxwriter * `Using Pandas and XlsxWriter to create Excel charts `_ -Video Tutorials +Video tutorials --------------- * `Pandas From The Ground Up `_ @@ -96,7 +96,7 @@ Video Tutorials `Jupyter Notebook `__ -Various Tutorials +Various tutorials ----------------- * `Wes McKinney's (pandas BDFL) blog `_ diff --git a/doc/source/install.rst b/doc/source/install.rst index 013a27c980e97..352b56ebd3020 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -236,7 +236,7 @@ Package Minimum support .. _install.recommended_dependencies: -Recommended Dependencies +Recommended dependencies ~~~~~~~~~~~~~~~~~~~~~~~~ * `numexpr `__: for accelerating certain numerical operations. @@ -255,7 +255,7 @@ Recommended Dependencies .. _install.optional_dependencies: -Optional Dependencies +Optional dependencies ~~~~~~~~~~~~~~~~~~~~~ Pandas has many optional dependencies that are only used for specific methods. @@ -299,7 +299,7 @@ zlib Compression for msgpack .. _optional_html: -Optional Dependencies for Parsing HTML +Optional dependencies for parsing HTML ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ One of the following combinations of libraries is needed to use the diff --git a/doc/source/reference/arrays.rst b/doc/source/reference/arrays.rst index 38406bf5b2656..77a87cafb9258 100644 --- a/doc/source/reference/arrays.rst +++ b/doc/source/reference/arrays.rst @@ -3,7 +3,7 @@ .. _api.arrays: ============= -Pandas Arrays +Pandas arrays ============= .. currentmodule:: pandas @@ -37,7 +37,7 @@ stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFra .. _api.arrays.datetime: -Datetime Data +Datetime data ------------- NumPy cannot natively represent timezone-aware datetimes. Pandas supports this @@ -156,7 +156,7 @@ If the data are tz-aware, then every value in the array must have the same timez .. _api.arrays.timedelta: -Timedelta Data +Timedelta data -------------- NumPy can natively represent timedeltas. Pandas provides :class:`Timedelta` @@ -211,7 +211,7 @@ A collection of timedeltas may be stored in a :class:`TimedeltaArray`. .. _api.arrays.period: -Timespan Data +Timespan data ------------- Pandas represents spans of times as :class:`Period` objects. @@ -277,7 +277,7 @@ Every period in a ``PeriodArray`` must have the same ``freq``. .. _api.arrays.interval: -Interval Data +Interval data ------------- Arbitrary intervals can be represented as :class:`Interval` objects. @@ -342,7 +342,7 @@ A collection of intervals may be stored in an :class:`arrays.IntervalArray`. .. _api.arrays.integer_na: -Nullable Integer +Nullable integer ---------------- :class:`numpy.ndarray` cannot natively represent integer-data with missing values. @@ -369,7 +369,7 @@ Pandas provides this through :class:`arrays.IntegerArray`. .. _api.arrays.categorical: -Categorical Data +Categorical data ---------------- Pandas defines a custom data type for representing data that can take only a @@ -434,7 +434,7 @@ data. See :ref:`api.series.cat` for more. .. _api.arrays.sparse: -Sparse Data +Sparse data ----------- Data where a single value is repeated many times (e.g. ``0`` or ``NaN``) may diff --git a/doc/source/reference/frame.rst b/doc/source/reference/frame.rst index 7d5cd5d245631..6ae2ea6e392e6 100644 --- a/doc/source/reference/frame.rst +++ b/doc/source/reference/frame.rst @@ -115,7 +115,7 @@ Binary operator functions DataFrame.combine DataFrame.combine_first -Function application, GroupBy & Window +Function application, GroupBy & window ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -133,7 +133,7 @@ Function application, GroupBy & Window .. _api.dataframe.stats: -Computations / Descriptive Stats +Computations / descriptive stats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -177,7 +177,7 @@ Computations / Descriptive Stats DataFrame.var DataFrame.nunique -Reindexing / Selection / Label manipulation +Reindexing / selection / label manipulation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -312,7 +312,7 @@ specific plotting methods of the form ``DataFrame.plot.``. .. _api.frame.sparse: -Sparse Accessor +Sparse accessor ~~~~~~~~~~~~~~~ Sparse-dtype specific methods and attributes are provided under the @@ -332,7 +332,7 @@ Sparse-dtype specific methods and attributes are provided under the DataFrame.sparse.to_dense -Serialization / IO / Conversion +Serialization / IO / conversion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/groupby.rst b/doc/source/reference/groupby.rst index 5c8a563a47d00..921eb737aef07 100644 --- a/doc/source/reference/groupby.rst +++ b/doc/source/reference/groupby.rst @@ -40,7 +40,7 @@ Function application GroupBy.transform GroupBy.pipe -Computations / Descriptive Stats +Computations / descriptive stats -------------------------------- .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 31b493e472099..12ca318c815d3 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -3,7 +3,7 @@ .. _api: ============= -API Reference +API reference ============= This page gives an overview of all public pandas objects, functions and diff --git a/doc/source/reference/indexing.rst b/doc/source/reference/indexing.rst index 8931caf394388..bbac964e8a201 100644 --- a/doc/source/reference/indexing.rst +++ b/doc/source/reference/indexing.rst @@ -3,7 +3,7 @@ .. _api.indexing: ============= -Index Objects +Index objects ============= Index @@ -48,7 +48,7 @@ Properties Index.T Index.memory_usage -Modifying and Computations +Modifying and computations ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -96,7 +96,7 @@ Compatibility with MultiIndex Index.is_lexsorted_for_tuple Index.droplevel -Missing Values +Missing values ~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -205,7 +205,7 @@ CategoricalIndex CategoricalIndex -Categorical Components +Categorical components ~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -222,7 +222,7 @@ Categorical Components CategoricalIndex.as_ordered CategoricalIndex.as_unordered -Modifying and Computations +Modifying and computations ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -240,7 +240,7 @@ IntervalIndex IntervalIndex -IntervalIndex Components +IntervalIndex components ~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -278,7 +278,7 @@ MultiIndex IndexSlice -MultiIndex Constructors +MultiIndex constructors ~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -288,7 +288,7 @@ MultiIndex Constructors MultiIndex.from_product MultiIndex.from_frame -MultiIndex Properties +MultiIndex properties ~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -299,7 +299,7 @@ MultiIndex Properties MultiIndex.nlevels MultiIndex.levshape -MultiIndex Components +MultiIndex components ~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -316,7 +316,7 @@ MultiIndex Components MultiIndex.reorder_levels MultiIndex.remove_unused_levels -MultiIndex Selecting +MultiIndex selecting ~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ @@ -336,7 +336,7 @@ DatetimeIndex DatetimeIndex -Time/Date Components +Time/Date components ~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/io.rst b/doc/source/reference/io.rst index 9c776e3ff8a82..666220d390cdc 100644 --- a/doc/source/reference/io.rst +++ b/doc/source/reference/io.rst @@ -3,7 +3,7 @@ .. _api.io: ============ -Input/Output +Input/output ============ .. currentmodule:: pandas @@ -14,7 +14,7 @@ Pickling read_pickle -Flat File +Flat file ~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/offset_frequency.rst b/doc/source/reference/offset_frequency.rst index ccc1c7e171d22..4a58055f1c955 100644 --- a/doc/source/reference/offset_frequency.rst +++ b/doc/source/reference/offset_frequency.rst @@ -3,7 +3,7 @@ .. _api.dateoffsets: ============ -Date Offsets +Date offsets ============ .. currentmodule:: pandas.tseries.offsets diff --git a/doc/source/reference/resampling.rst b/doc/source/reference/resampling.rst index 2a52defa3c68f..57263139d9c18 100644 --- a/doc/source/reference/resampling.rst +++ b/doc/source/reference/resampling.rst @@ -43,7 +43,7 @@ Upsampling Resampler.asfreq Resampler.interpolate -Computations / Descriptive Stats +Computations / descriptive stats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index a061f696f4b30..e8e2f64e22cb5 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -119,7 +119,7 @@ Binary operator functions Series.product Series.dot -Function application, GroupBy & Window +Function application, groupby & window -------------------------------------- .. autosummary:: :toctree: api/ @@ -137,7 +137,7 @@ Function application, GroupBy & Window .. _api.series.stats: -Computations / Descriptive Stats +Computations / descriptive stats -------------------------------- .. autosummary:: :toctree: api/ @@ -188,7 +188,7 @@ Computations / Descriptive Stats Series.value_counts Series.compound -Reindexing / Selection / Label manipulation +Reindexing / selection / label manipulation ------------------------------------------- .. autosummary:: :toctree: api/ @@ -296,14 +296,14 @@ Sparse :ref:`sparse ` .. _api.series.dt: -Datetimelike Properties +Datetimelike properties ~~~~~~~~~~~~~~~~~~~~~~~ ``Series.dt`` can be used to access the values of the series as datetimelike and return several properties. These can be accessed like ``Series.dt.``. -Datetime Properties +Datetime properties ^^^^^^^^^^^^^^^^^^^ .. autosummary:: @@ -339,7 +339,7 @@ Datetime Properties Series.dt.tz Series.dt.freq -Datetime Methods +Datetime methods ^^^^^^^^^^^^^^^^ .. autosummary:: @@ -358,7 +358,7 @@ Datetime Methods Series.dt.month_name Series.dt.day_name -Period Properties +Period properties ^^^^^^^^^^^^^^^^^ .. autosummary:: @@ -369,7 +369,7 @@ Period Properties Series.dt.start_time Series.dt.end_time -Timedelta Properties +Timedelta properties ^^^^^^^^^^^^^^^^^^^^ .. autosummary:: @@ -382,7 +382,7 @@ Timedelta Properties Series.dt.nanoseconds Series.dt.components -Timedelta Methods +Timedelta methods ^^^^^^^^^^^^^^^^^ .. autosummary:: @@ -478,7 +478,7 @@ strings and apply several methods to it. These can be accessed like .. _api.series.cat: -Categorical Accessor +Categorical accessor ~~~~~~~~~~~~~~~~~~~~ Categorical-dtype specific methods and attributes are available under @@ -508,7 +508,7 @@ the ``Series.cat`` accessor. .. _api.series.sparse: -Sparse Accessor +Sparse accessor ~~~~~~~~~~~~~~~ Sparse-dtype specific methods and attributes are provided under the @@ -560,7 +560,7 @@ specific plotting methods of the form ``Series.plot.``. Series.hist -Serialization / IO / Conversion +Serialization / IO / conversion ------------------------------- .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/style.rst b/doc/source/reference/style.rst index bd9635b41e343..3d155535e2585 100644 --- a/doc/source/reference/style.rst +++ b/doc/source/reference/style.rst @@ -9,7 +9,7 @@ Style ``Styler`` objects are returned by :attr:`pandas.DataFrame.style`. -Styler Constructor +Styler constructor ------------------ .. autosummary:: :toctree: api/ @@ -17,7 +17,7 @@ Styler Constructor Styler Styler.from_custom_template -Styler Properties +Styler properties ----------------- .. autosummary:: :toctree: api/ @@ -26,7 +26,7 @@ Styler Properties Styler.template Styler.loader -Style Application +Style application ----------------- .. autosummary:: :toctree: api/ @@ -44,7 +44,7 @@ Style Application Styler.clear Styler.pipe -Builtin Styles +Builtin styles -------------- .. autosummary:: :toctree: api/ @@ -55,7 +55,7 @@ Builtin Styles Styler.background_gradient Styler.bar -Style Export and Import +Style export and import ----------------------- .. autosummary:: :toctree: api/ diff --git a/doc/source/user_guide/advanced.rst b/doc/source/user_guide/advanced.rst index eb1ca97e465f8..280eb05964787 100644 --- a/doc/source/user_guide/advanced.rst +++ b/doc/source/user_guide/advanced.rst @@ -3,7 +3,7 @@ {{ header }} ****************************** -MultiIndex / Advanced Indexing +MultiIndex / advanced indexing ****************************** This section covers :ref:`indexing with a MultiIndex ` @@ -179,7 +179,7 @@ on a deeper level. .. _advanced.shown_levels: -Defined Levels +Defined levels ~~~~~~~~~~~~~~ The :class:`MultiIndex` keeps all the defined levels of an index, even @@ -642,7 +642,7 @@ And now selection works as expected. dfm.loc[(0, 'y'):(1, 'z')] -Take Methods +Take methods ------------ .. _advanced.take: @@ -712,7 +712,7 @@ faster than fancy indexing. .. _indexing.index_types: -Index Types +Index types ----------- We have discussed ``MultiIndex`` in the previous sections pretty extensively. @@ -981,7 +981,7 @@ bins, with ``NaN`` representing a missing value similar to other dtypes. pd.cut([0, 3, 5, 1], bins=c.categories) -Generating Ranges of Intervals +Generating ranges of intervals ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If we need intervals on a regular frequency, we can use the :func:`interval_range` function diff --git a/doc/source/user_guide/categorical.rst b/doc/source/user_guide/categorical.rst index a6315c548b382..7dca34385c1ee 100644 --- a/doc/source/user_guide/categorical.rst +++ b/doc/source/user_guide/categorical.rst @@ -3,7 +3,7 @@ {{ header }} **************** -Categorical Data +Categorical data **************** This is an introduction to pandas categorical data type, including a short comparison @@ -38,10 +38,10 @@ See also the :ref:`API docs on categoricals`. .. _categorical.objectcreation: -Object Creation +Object creation --------------- -Series Creation +Series creation ~~~~~~~~~~~~~~~ Categorical ``Series`` or columns in a ``DataFrame`` can be created in several ways: @@ -90,7 +90,7 @@ Categorical data has a specific ``category`` :ref:`dtype `: df.dtypes -DataFrame Creation +DataFrame creation ~~~~~~~~~~~~~~~~~~ Similar to the previous section where a single column was converted to categorical, all columns in a @@ -130,7 +130,7 @@ This conversion is likewise done column by column: df_cat['B'] -Controlling Behavior +Controlling behavior ~~~~~~~~~~~~~~~~~~~~ In the examples above where we passed ``dtype='category'``, we used the default @@ -181,7 +181,7 @@ during normal constructor mode: categories=["train", "test"])) -Regaining Original Data +Regaining original data ~~~~~~~~~~~~~~~~~~~~~~~ To get back to the original ``Series`` or NumPy array, use @@ -243,7 +243,7 @@ expects a `dtype`. For example :func:`pandas.read_csv`, array. In other words, ``dtype='category'`` is equivalent to ``dtype=CategoricalDtype()``. -Equality Semantics +Equality semantics ~~~~~~~~~~~~~~~~~~ Two instances of :class:`~pandas.api.types.CategoricalDtype` compare equal @@ -438,7 +438,7 @@ use :meth:`~pandas.Categorical.set_categories`. intentionally or because it is misspelled or (under Python3) due to a type difference (e.g., NumPy S1 dtype and Python strings). This can result in surprising behaviour! -Sorting and Order +Sorting and order ----------------- .. _categorical.sort: @@ -510,7 +510,7 @@ necessarily make the sort order the same as the categories order. (e.g. :meth:`Series.median`, which would need to compute the mean between two values if the length of an array is even) do not work and raise a ``TypeError``. -Multi Column Sorting +Multi column sorting ~~~~~~~~~~~~~~~~~~~~ A categorical dtyped column will participate in a multi-column sort in a similar manner to other columns. @@ -963,7 +963,7 @@ Following table summarizes the results of ``Categoricals`` related concatenation +----------+--------------------------------------------------------+----------------------------+ -Getting Data In/Out +Getting data in/out ------------------- You can write data that contains ``category`` dtypes to a ``HDFStore``. @@ -1000,7 +1000,7 @@ relevant columns back to `category` and assign the right categories and categori The same holds for writing to a SQL database with ``to_sql``. -Missing Data +Missing data ------------ pandas primarily uses the value `np.nan` to represent missing data. It is by @@ -1052,7 +1052,7 @@ Gotchas .. _categorical.rfactor: -Memory Usage +Memory usage ~~~~~~~~~~~~ .. _categorical.memory: @@ -1152,7 +1152,7 @@ You can use ``fillna`` to handle missing values before applying a function. df.apply(lambda row: type(row["cats"]), axis=1) df.apply(lambda col: col.dtype, axis=0) -Categorical Index +Categorical index ~~~~~~~~~~~~~~~~~ ``CategoricalIndex`` is a type of index that is useful for supporting @@ -1173,7 +1173,7 @@ Setting the index will create a ``CategoricalIndex``: # This now sorts by the categories order df.sort_index() -Side Effects +Side effects ~~~~~~~~~~~~ Constructing a ``Series`` from a ``Categorical`` will not copy the input diff --git a/doc/source/user_guide/computation.rst b/doc/source/user_guide/computation.rst index 71cbf58dff871..a2f93dcf337d7 100644 --- a/doc/source/user_guide/computation.rst +++ b/doc/source/user_guide/computation.rst @@ -5,12 +5,12 @@ Computational tools =================== -Statistical Functions +Statistical functions --------------------- .. _computation.pct_change: -Percent Change +Percent change ~~~~~~~~~~~~~~ ``Series`` and ``DataFrame`` have a method @@ -294,7 +294,7 @@ sugar for applying the moving window operator to all of the DataFrame's columns: .. _stats.summary: -Method Summary +Method summary ~~~~~~~~~~~~~~ We provide a number of common statistical functions: @@ -335,7 +335,7 @@ compute the mean absolute deviation on a rolling basis: .. _stats.rolling_window: -Rolling Windows +Rolling windows ~~~~~~~~~~~~~~~ Passing ``win_type`` to ``.rolling`` generates a generic rolling window computation, that is weighted according the ``win_type``. @@ -404,7 +404,7 @@ For some windowing functions, additional parameters must be specified: .. _stats.moments.ts: -Time-aware Rolling +Time-aware rolling ~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.19.0 @@ -469,7 +469,7 @@ default of the index) in a DataFrame. .. _stats.rolling_window.endpoints: -Rolling Window Endpoints +Rolling window endpoints ~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.20.0 @@ -511,7 +511,7 @@ For fixed windows, the closed parameter cannot be set and the rolling window wil .. _stats.moments.ts-versus-resampling: -Time-aware Rolling vs. Resampling +Time-aware rolling vs. resampling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using ``.rolling()`` with a time-based index is quite similar to :ref:`resampling `. They @@ -529,7 +529,7 @@ will have the shape of a regular frequency between the min and the max of the or To summarize, ``.rolling()`` is a time-based window operation, while ``.resample()`` is a frequency-based window operation. -Centering Windows +Centering windows ~~~~~~~~~~~~~~~~~ By default the labels are set to the right edge of the window, but a @@ -542,7 +542,7 @@ By default the labels are set to the right edge of the window, but a .. _stats.moments.binary: -Binary Window Functions +Binary window functions ~~~~~~~~~~~~~~~~~~~~~~~ :meth:`~Rolling.cov` and :meth:`~Rolling.corr` can compute moving window statistics about @@ -695,7 +695,7 @@ Furthermore you can pass a nested dict to indicate different aggregations on dif .. _stats.moments.expanding: -Expanding Windows +Expanding windows ----------------- A common alternative to rolling statistics is to use an *expanding* window, @@ -716,7 +716,7 @@ they are implemented in pandas such that the following two calls are equivalent: These have a similar set of methods to ``.rolling`` methods. -Method Summary +Method summary ~~~~~~~~~~~~~~ .. currentmodule:: pandas.core.window @@ -798,7 +798,7 @@ relative impact of an individual data point. As an example, here is the .. _stats.moments.exponentially_weighted: -Exponentially Weighted Windows +Exponentially weighted windows ------------------------------ .. currentmodule:: pandas.core.window diff --git a/doc/source/user_guide/cookbook.rst b/doc/source/user_guide/cookbook.rst index 772362cab396c..15af5208a4f1f 100644 --- a/doc/source/user_guide/cookbook.rst +++ b/doc/source/user_guide/cookbook.rst @@ -99,7 +99,7 @@ Splitting df[df.AAA <= 5] df[df.AAA > 5] -Building Criteria +Building criteria ***************** `Select with multi-column criteria @@ -245,7 +245,7 @@ Ambiguity arises when an index consists of integers with a non-zero start or non df[~((df.AAA <= 6) & (df.index.isin([0, 2, 4])))] -New Columns +New columns *********** `Efficiently and dynamically creating new columns using applymap @@ -399,7 +399,7 @@ Sorting df.sort_values(by=('Labs', 'II'), ascending=False) -`Partial Selection, the need for sortedness; +`Partial selection, the need for sortedness; `__ Levels @@ -413,7 +413,7 @@ Levels .. _cookbook.missing_data: -Missing Data +Missing data ------------ The :ref:`missing data` docs. @@ -485,7 +485,7 @@ Unlike agg, apply's callable is passed a sub-DataFrame which gives you access to expected_df = gb.apply(GrowUp) expected_df -`Expanding Apply +`Expanding apply `__ .. ipython:: python @@ -595,7 +595,7 @@ Unlike agg, apply's callable is passed a sub-DataFrame which gives you access to df.A.groupby((df.A != df.A.shift()).cumsum()).groups df.A.groupby((df.A != df.A.shift()).cumsum()).cumsum() -Expanding Data +Expanding data ************** `Alignment and to-date @@ -690,7 +690,7 @@ To create year and month cross tabulation: Apply ***** -`Rolling Apply to Organize - Turning embedded lists into a MultiIndex frame +`Rolling apply to organize - Turning embedded lists into a MultiIndex frame `__ .. ipython:: python @@ -706,7 +706,7 @@ Apply for ind, row in df.iterrows()}) df_orgz -`Rolling Apply with a DataFrame returning a Series +`Rolling apply with a DataFrame returning a Series `__ Rolling Apply to multiple columns where function calculates a Series before a Scalar from the Series is returned @@ -1099,7 +1099,7 @@ HDFStore The :ref:`HDFStores ` docs -`Simple Queries with a Timestamp Index +`Simple queries with a Timestamp Index `__ `Managing heterogeneous data using a linked multiple table hierarchy @@ -1169,7 +1169,7 @@ Storing Attributes to a group node .. _cookbook.binary: -Binary Files +Binary files ************ pandas readily accepts NumPy record arrays, if you need to read in a binary @@ -1334,7 +1334,7 @@ Values can be set to NaT using np.nan, similar to datetime y[1] = np.nan y -Aliasing Axis Names +Aliasing axis names ------------------- To globally provide aliases for axis names, one can define these 2 functions: @@ -1361,7 +1361,7 @@ To globally provide aliases for axis names, one can define these 2 functions: df2.sum(axis='myaxis2') clear_axis_alias(pd.DataFrame, 'columns', 'myaxis2') -Creating Example Data +Creating example data --------------------- To create a dataframe from every combination of some given values, like R's ``expand.grid()`` diff --git a/doc/source/user_guide/enhancingperf.rst b/doc/source/user_guide/enhancingperf.rst index 525f9abb1d1ae..c15991fabfd3b 100644 --- a/doc/source/user_guide/enhancingperf.rst +++ b/doc/source/user_guide/enhancingperf.rst @@ -3,7 +3,7 @@ {{ header }} ********************* -Enhancing Performance +Enhancing performance ********************* In this part of the tutorial, we will investigate how to speed up certain @@ -15,7 +15,7 @@ when we use Cython and Numba on a test function operating row-wise on the .. _enhancingperf.cython: -Cython (Writing C extensions for pandas) +Cython (writing C extensions for pandas) ---------------------------------------- For many use cases writing pandas in pure Python and NumPy is sufficient. In some @@ -33,7 +33,7 @@ faster than the pure Python solution. .. _enhancingperf.pure: -Pure python +Pure Python ~~~~~~~~~~~ We have a ``DataFrame`` to which we want to apply a function row-wise. @@ -429,7 +429,7 @@ Read more in the `Numba docs `__. .. _enhancingperf.eval: -Expression Evaluation via :func:`~pandas.eval` +Expression evaluation via :func:`~pandas.eval` ----------------------------------------------- The top-level function :func:`pandas.eval` implements expression evaluation of @@ -465,7 +465,7 @@ engine in addition to some extensions available only in pandas. The larger the frame and the larger the expression the more speedup you will see from using :func:`~pandas.eval`. -Supported Syntax +Supported syntax ~~~~~~~~~~~~~~~~ These operations are supported by :func:`pandas.eval`: @@ -505,7 +505,7 @@ This Python syntax is **not** allowed: -:func:`~pandas.eval` Examples +:func:`~pandas.eval` examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :func:`pandas.eval` works well with expressions containing large arrays. @@ -669,7 +669,7 @@ whether the query modifies the original frame. Unlike with ``eval``, the default value for ``inplace`` for ``query`` is ``False``. This is consistent with prior versions of pandas. -Local Variables +Local variables ~~~~~~~~~~~~~~~ You must *explicitly reference* any local variable that you want to use in an @@ -714,7 +714,7 @@ standard Python. pd.eval('a + b') -:func:`pandas.eval` Parsers +:func:`pandas.eval` parsers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two different parsers and two different engines you can use as @@ -754,7 +754,7 @@ The ``and`` and ``or`` operators here have the same precedence that they would in vanilla Python. -:func:`pandas.eval` Backends +:func:`pandas.eval` backends ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There's also the option to make :func:`~pandas.eval` operate identical to plain @@ -779,7 +779,7 @@ is a bit slower (not by much) than evaluating the same expression in Python %timeit pd.eval('df1 + df2 + df3 + df4', engine='python') -:func:`pandas.eval` Performance +:func:`pandas.eval` performance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :func:`~pandas.eval` is intended to speed up certain kinds of operations. In @@ -804,7 +804,7 @@ computation. The two lines are two different engines. This plot was created using a ``DataFrame`` with 3 columns each containing floating point values generated using ``numpy.random.randn()``. -Technical Minutia Regarding Expression Evaluation +Technical minutia regarding expression evaluation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Expressions that would result in an object dtype or involve datetime operations diff --git a/doc/source/user_guide/gotchas.rst b/doc/source/user_guide/gotchas.rst index 3d89fe171a343..f9a72b87e58d8 100644 --- a/doc/source/user_guide/gotchas.rst +++ b/doc/source/user_guide/gotchas.rst @@ -75,7 +75,7 @@ See also :ref:`Categorical Memory Usage `. .. _gotchas.truth: -Using If/Truth Statements with pandas +Using if/truth statements with pandas ------------------------------------- pandas follows the NumPy convention of raising an error when you try to convert @@ -317,7 +317,7 @@ See `this link ` and the dfg.groupby(["A", [0, 0, 0, 1, 1]]).ngroup() -Groupby by Indexer to 'resample' data +Groupby by indexer to 'resample' data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Resampling produces new hypothetical samples (resamples) from already existing observed data or from a model that generates data. These new samples are similar to the pre-existing samples. diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index 02522e95a2d79..c09eb87df0368 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -3,7 +3,7 @@ {{ header }} *************************** -Indexing and Selecting Data +Indexing and selecting data *************************** The axis labeling information in pandas objects serves many purposes: @@ -46,7 +46,7 @@ See the :ref:`cookbook` for some advanced strategies. .. _indexing.choice: -Different Choices for Indexing +Different choices for indexing ------------------------------ Object selection has had a number of user-requested additions in order to @@ -181,7 +181,7 @@ columns. df[['A', 'B']] -Attribute Access +Attribute access ---------------- .. _indexing.columns.multiple: @@ -287,7 +287,7 @@ largely as a convenience since it is such a common operation. .. _indexing.label: -Selection By Label +Selection by label ------------------ .. warning:: @@ -420,7 +420,7 @@ above example, ``s.loc[1:6]`` would raise ``KeyError``. .. _indexing.integer: -Selection By Position +Selection by position --------------------- .. warning:: @@ -533,7 +533,7 @@ A list of indexers where any element is out of bounds will raise an .. _indexing.callable: -Selection By Callable +Selection by callable --------------------- .. versionadded:: 0.18.1 @@ -573,7 +573,7 @@ without using a temporary variable. .. _indexing.deprecate_ix: -IX Indexer is Deprecated +IX indexer is deprecated ------------------------ .. warning:: @@ -631,7 +631,7 @@ For getting *multiple* indexers, using ``.get_indexer``: .. _deprecate_loc_reindex_listlike: .. _indexing.deprecate_loc_reindex_listlike: -Indexing with list with missing labels is Deprecated +Indexing with list with missing labels is deprecated ---------------------------------------------------- .. warning:: @@ -655,7 +655,7 @@ Selection with all keys found is unchanged. s.loc[[1, 2]] -Previous Behavior +Previous behavior .. code-block:: ipython @@ -667,7 +667,7 @@ Previous Behavior dtype: float64 -Current Behavior +Current behavior .. code-block:: ipython @@ -732,7 +732,7 @@ However, this would *still* raise if your resulting index is duplicated. .. _indexing.basics.partial_setting: -Selecting Random Samples +Selecting random samples ------------------------ A random selection of rows or columns from a Series or DataFrame with the :meth:`~DataFrame.sample` method. The method will sample rows by default, and accepts a specific number of rows/columns to return, or a fraction of rows. @@ -807,7 +807,7 @@ Finally, one can also set a seed for ``sample``'s random number generator using -Setting With Enlargement +Setting with enlargement ------------------------ The ``.loc/[]`` operations can perform enlargement when setting a non-existent key for that axis. @@ -1076,7 +1076,7 @@ without creating a copy: df.where(df < 0, -df) == np.where(df < 0, df, -df) -**alignment** +**Alignment** Furthermore, ``where`` aligns the input boolean condition (ndarray or DataFrame), such that partial selection with setting is possible. This is analogous to @@ -1351,7 +1351,7 @@ to ``in``/``not in``. df[df.c.isin([1, 2])] -Boolean Operators +Boolean operators ~~~~~~~~~~~~~~~~~ You can negate boolean expressions with the word ``not`` or the ``~`` operator. @@ -1407,7 +1407,7 @@ floating point values generated using ``numpy.random.randn()``. df2 = df.copy() -Duplicate Data +Duplicate data -------------- .. _indexing.duplicate: @@ -1474,7 +1474,7 @@ default value. s.get('a') # equivalent to s['a'] s.get('x', default=-1) -The :meth:`~pandas.DataFrame.lookup` Method +The :meth:`~pandas.DataFrame.lookup` method ------------------------------------------- Sometimes you want to extract a set of values given a sequence of row labels @@ -1628,7 +1628,7 @@ Missing values idx2 idx2.fillna(pd.Timestamp('2011-01-02')) -Set / Reset Index +Set / reset index ----------------- Occasionally you will load or create a data set into a DataFrame and want to diff --git a/doc/source/user_guide/integer_na.rst b/doc/source/user_guide/integer_na.rst index c5667e9319ca6..97b9c2f95dc50 100644 --- a/doc/source/user_guide/integer_na.rst +++ b/doc/source/user_guide/integer_na.rst @@ -5,7 +5,7 @@ .. _integer_na: ************************** -Nullable Integer Data Type +Nullable integer data type ************************** .. versionadded:: 0.24.0 diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 7caaec62c0a8a..ece8c385cd1d3 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -13,7 +13,7 @@ =============================== -IO Tools (Text, CSV, HDF5, ...) +IO tools (text, CSV, HDF5, ...) =============================== The pandas I/O API is a set of top level ``reader`` functions accessed like @@ -51,7 +51,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like .. _io.read_csv_table: -CSV & Text files +CSV & text files ---------------- The workhorse function for reading text files (a.k.a. flat files) is @@ -88,7 +88,7 @@ delim_whitespace : boolean, default False .. versionadded:: 0.18.1 support for the Python parser. -Column and Index Locations and Names +Column and index locations and names ++++++++++++++++++++++++++++++++++++ header : int or list of ints, default ``'infer'`` @@ -155,7 +155,7 @@ mangle_dupe_cols : boolean, default ``True`` Passing in ``False`` will cause data to be overwritten if there are duplicate names in the columns. -General Parsing Configuration +General parsing configuration +++++++++++++++++++++++++++++ dtype : Type name or dict of column -> type, default ``None`` @@ -211,7 +211,7 @@ memory_map : boolean, default False directly onto memory and access the data directly from there. Using this option can improve performance because there is no longer any I/O overhead. -NA and Missing Data Handling +NA and missing data handling ++++++++++++++++++++++++++++ na_values : scalar, str, list-like, or dict, default ``None`` @@ -243,7 +243,7 @@ verbose : boolean, default ``False`` skip_blank_lines : boolean, default ``True`` If ``True``, skip over blank lines rather than interpreting as NaN values. -Datetime Handling +Datetime handling +++++++++++++++++ parse_dates : boolean or list of ints or names or list of lists or dict, default ``False``. @@ -263,7 +263,7 @@ keep_date_col : boolean, default ``False`` date_parser : function, default ``None`` Function to use for converting a sequence of string columns to an array of datetime instances. The default uses ``dateutil.parser.parser`` to do the - conversion. Pandas will try to call date_parser in three different ways, + conversion. pandas will try to call date_parser in three different ways, advancing to the next if an exception occurs: 1) Pass one or more arrays (as defined by parse_dates) as arguments; 2) concatenate (row-wise) the string values from the columns defined by parse_dates into a single array and pass @@ -288,7 +288,7 @@ chunksize : int, default ``None`` Return `TextFileReader` object for iteration. See :ref:`iterating and chunking ` below. -Quoting, Compression, and File Format +Quoting, compression, and file format +++++++++++++++++++++++++++++++++++++ compression : {``'infer'``, ``'gzip'``, ``'bz2'``, ``'zip'``, ``'xz'``, ``None``}, default ``'infer'`` @@ -348,7 +348,7 @@ tupleize_cols : boolean, default ``False`` Leave a list of tuples on columns as is (default is to convert to a MultiIndex on the columns). -Error Handling +Error handling ++++++++++++++ error_bad_lines : boolean, default ``True`` @@ -460,7 +460,7 @@ worth trying. .. _io.categorical: -Specifying Categorical dtype +Specifying categorical dtype '''''''''''''''''''''''''''' .. versionadded:: 0.19.0 @@ -529,7 +529,7 @@ This matches the behavior of :meth:`Categorical.set_categories`. df['col3'] -Naming and Using Columns +Naming and using columns '''''''''''''''''''''''' .. _io.headers: @@ -646,7 +646,7 @@ use in the final result: In this case, the callable is specifying that we exclude the "a" and "c" columns from the output. -Comments and Empty Lines +Comments and empty lines '''''''''''''''''''''''' .. _io.skiplines: @@ -759,7 +759,7 @@ We can suppress the comments using the ``comment`` keyword: .. _io.unicode: -Dealing with Unicode Data +Dealing with Unicode data ''''''''''''''''''''''''' The ``encoding`` argument should be used for encoded unicode data, which will @@ -834,7 +834,7 @@ If a subset of data is being parsed using the ``usecols`` option, the Date Handling ''''''''''''' -Specifying Date Columns +Specifying date columns +++++++++++++++++++++++ To better facilitate working with datetime data, :func:`read_csv` @@ -947,7 +947,7 @@ data columns: specify `index_col` as a column label rather then as an index on the resulting frame. -Date Parsing Functions +Date parsing functions ++++++++++++++++++++++ Finally, the parser allows you to specify a custom ``date_parser`` function to @@ -1001,7 +1001,7 @@ a single date rather than the entire array. .. _io.csv.mixed_timezones: -Parsing a CSV with mixed Timezones +Parsing a CSV with mixed timezones ++++++++++++++++++++++++++++++++++ Pandas cannot natively represent a column or index with mixed timezones. If your CSV @@ -1031,7 +1031,7 @@ To parse the mixed-timezone values as a datetime column, pass a partially-applie .. _io.dayfirst: -Inferring Datetime Format +Inferring datetime format +++++++++++++++++++++++++ If you have ``parse_dates`` enabled for some or all of your columns, and your @@ -1070,7 +1070,7 @@ Note that ``infer_datetime_format`` is sensitive to ``dayfirst``. With os.remove('foo.csv') -International Date Formats +International date formats ++++++++++++++++++++++++++ While US date formats tend to be MM/DD/YYYY, many international formats use @@ -1118,7 +1118,7 @@ writing to a file). For example: .. _io.thousands: -Thousand Separators +Thousand separators ''''''''''''''''''' For large numbers that have been written with a thousands separator, you can @@ -1163,7 +1163,7 @@ The ``thousands`` keyword allows integers to be parsed correctly: .. _io.na_values: -NA Values +NA values ''''''''' To control which values are parsed as missing values (which are signified by @@ -1385,7 +1385,7 @@ should pass the ``escapechar`` option: .. _io.fwf: -Files with Fixed Width Columns +Files with fixed width columns '''''''''''''''''''''''''''''' While :func:`read_csv` reads delimited data, the :func:`read_fwf` function works @@ -1686,7 +1686,7 @@ documentation on credentials -Writing out Data +Writing out data '''''''''''''''' .. _io.store_in_csv: @@ -1805,7 +1805,7 @@ Note ``NaN``'s, ``NaT``'s and ``None`` will be converted to ``null`` and ``datet json = dfj.to_json() json -Orient Options +Orient options ++++++++++++++ There are a number of different options for the format of the resulting JSON @@ -1869,7 +1869,7 @@ preservation of metadata including but not limited to dtypes and index names. index and column labels during round-trip serialization. If you wish to preserve label ordering use the `split` option as it uses ordered containers. -Date Handling +Date handling +++++++++++++ Writing in ISO date format: @@ -1910,7 +1910,7 @@ Writing to a file, with a date index and a date column: with open('test.json') as fh: print(fh.read()) -Fallback Behavior +Fallback behavior +++++++++++++++++ If the JSON serializer cannot handle the container contents directly it will @@ -2003,7 +2003,7 @@ If a non-default ``orient`` was used when encoding to JSON be sure to pass the s option here so that decoding produces sensible results, see `Orient Options`_ for an overview. -Data Conversion +Data conversion +++++++++++++++ The default of ``convert_axes=True``, ``dtype=True``, and ``convert_dates=True`` @@ -2090,7 +2090,7 @@ Dates written in nanoseconds need to be read back in nanoseconds: dfju = pd.read_json(json, date_unit='ns') dfju -The Numpy Parameter +The Numpy parameter +++++++++++++++++++ .. note:: @@ -2218,7 +2218,7 @@ For line-delimited json files, pandas can also return an iterator which reads in .. _io.table_schema: -Table Schema +Table schema '''''''''''' .. versionadded:: 0.20.0 @@ -2378,7 +2378,7 @@ HTML .. _io.read_html: -Reading HTML Content +Reading HTML content '''''''''''''''''''''' .. warning:: @@ -2797,7 +2797,7 @@ See the :ref:`cookbook` for some advanced strategies. .. _io.excel_reader: -Reading Excel Files +Reading Excel files ''''''''''''''''''' In the most basic use-case, ``read_excel`` takes a path to an Excel @@ -2879,7 +2879,7 @@ with ``on_demand=True``. .. _io.excel.specifying_sheets: -Specifying Sheets +Specifying sheets +++++++++++++++++ .. note :: The second argument is ``sheet_name``, not to be confused with ``ExcelFile.sheet_names``. @@ -2980,7 +2980,7 @@ should be passed to ``index_col`` and ``header``: os.remove('path_to_file.xlsx') -Parsing Specific Columns +Parsing specific columns ++++++++++++++++++++++++ It is often the case that users will insert columns to do temporary computations @@ -3035,7 +3035,7 @@ the column names, returning names where the callable function evaluates to ``Tru pd.read_excel('path_to_file.xls', 'Sheet1', usecols=lambda x: x.isalpha()) -Parsing Dates +Parsing dates +++++++++++++ Datetime-like values are normally automatically converted to the appropriate @@ -3048,7 +3048,7 @@ use the ``parse_dates`` keyword to parse those strings to datetimes: pd.read_excel('path_to_file.xls', 'Sheet1', parse_dates=['date_strings']) -Cell Converters +Cell converters +++++++++++++++ It is possible to transform the contents of Excel cells via the ``converters`` @@ -3073,7 +3073,7 @@ missing data to recover integer dtype: pd.read_excel('path_to_file.xls', 'Sheet1', converters={'MyInts': cfun}) -dtype Specifications +Dtype specifications ++++++++++++++++++++ .. versionadded:: 0.20 @@ -3089,10 +3089,10 @@ no type inference, use the type ``str`` or ``object``. .. _io.excel_writer: -Writing Excel Files +Writing Excel files ''''''''''''''''''' -Writing Excel Files to Disk +Writing Excel files to disk +++++++++++++++++++++++++++ To write a ``DataFrame`` object to a sheet of an Excel file, you can use the @@ -3138,7 +3138,7 @@ one can pass an :class:`~pandas.io.excel.ExcelWriter`. .. _io.excel_writing_buffer: -Writing Excel Files to Memory +Writing Excel files to memory +++++++++++++++++++++++++++++ Pandas supports writing Excel files to buffer-like objects such as ``StringIO`` or @@ -3218,7 +3218,7 @@ argument to ``to_excel`` and to ``ExcelWriter``. The built-in engines are: .. _io.excel.style: -Style and Formatting +Style and formatting '''''''''''''''''''' The look and feel of Excel worksheets created from pandas can be modified using the following parameters on the ``DataFrame``'s ``to_excel`` method. @@ -3452,7 +3452,7 @@ pandas objects. os.remove('foo.msg') os.remove('foo2.msg') -Read/Write API +Read/write API '''''''''''''' Msgpacks can also be read from and written to strings. @@ -3551,7 +3551,7 @@ Closing a Store and using a context manager: -Read/Write API +Read/write API '''''''''''''' ``HDFStore`` supports an top-level API using ``read_hdf`` for reading and ``to_hdf`` for writing, @@ -3597,7 +3597,7 @@ HDFStore will by default not drop rows that are all missing. This behavior can b .. _io.hdf5-fixed: -Fixed Format +Fixed format '''''''''''' The examples above show storing using ``put``, which write the HDF5 to ``PyTables`` in a fixed array format, called @@ -3621,7 +3621,7 @@ This format is specified by default when using ``put`` or ``to_hdf`` or by ``for .. _io.hdf5-table: -Table Format +Table format '''''''''''' ``HDFStore`` supports another ``PyTables`` format on disk, the ``table`` @@ -3663,7 +3663,7 @@ enable ``put/append/to_hdf`` to by default store in the ``table`` format. .. _io.hdf5-keys: -Hierarchical Keys +Hierarchical keys ''''''''''''''''' Keys to a store can be specified as a string. These can be in a @@ -3730,10 +3730,10 @@ will yield a tuple for each group key along with the relative keys of its conten .. _io.hdf5-types: -Storing Types +Storing types ''''''''''''' -Storing Mixed Types in a Table +Storing mixed types in a table ++++++++++++++++++++++++++++++ Storing mixed-dtype data is supported. Strings are stored as a @@ -3797,7 +3797,7 @@ storing/selecting from homogeneous index ``DataFrames``. Querying '''''''' -Querying a Table +Querying a table ++++++++++++++++ ``select`` and ``delete`` operations have an optional criterion that can @@ -4003,7 +4003,7 @@ See `here `__. .. _io.stata: -Stata Format +Stata format ------------ .. _io.stata_writer: -Writing to Stata format +Writing to stata format ''''''''''''''''''''''' The method :func:`~pandas.core.frame.DataFrame.to_stata` will write a DataFrame @@ -5372,7 +5372,7 @@ values will have ``object`` data type. .. _io.stata-categorical: -Categorical Data +Categorical data ++++++++++++++++ ``Categorical`` data can be exported to *Stata* data files as value labeled data. @@ -5418,7 +5418,7 @@ whether imported ``Categorical`` variables are ordered. .. _io.sas_reader: -SAS Formats +SAS formats ----------- The top-level function :func:`read_sas` can read (but not write) SAS @@ -5480,7 +5480,7 @@ easy conversion to and from pandas. .. _io.perf: -Performance Considerations +Performance considerations -------------------------- This is an informal comparison of various IO methods, using pandas diff --git a/doc/source/user_guide/merging.rst b/doc/source/user_guide/merging.rst index 25c486c839b7f..43d44ff30c64a 100644 --- a/doc/source/user_guide/merging.rst +++ b/doc/source/user_guide/merging.rst @@ -814,7 +814,7 @@ The ``indicator`` argument will also accept string arguments, in which case the .. _merging.dtypes: -Merge Dtypes +Merge dtypes ~~~~~~~~~~~~ .. versionadded:: 0.19.0 @@ -1361,7 +1361,7 @@ Timeseries friendly merging .. _merging.merge_ordered: -Merging Ordered Data +Merging ordered data ~~~~~~~~~~~~~~~~~~~~ A :func:`merge_ordered` function allows combining time series and other @@ -1381,7 +1381,7 @@ fill/interpolate missing data: .. _merging.merge_asof: -Merging AsOf +Merging asof ~~~~~~~~~~~~ .. versionadded:: 0.19.0 diff --git a/doc/source/user_guide/missing_data.rst b/doc/source/user_guide/missing_data.rst index cd70a109b3c77..1439296fb8296 100644 --- a/doc/source/user_guide/missing_data.rst +++ b/doc/source/user_guide/missing_data.rst @@ -74,7 +74,7 @@ Series and DataFrame objects: df2['one'] == np.nan -Integer Dtypes and Missing Data +Integer dtypes and missing data ------------------------------- Because ``NaN`` is a float, a column of integers with even one missing values @@ -175,7 +175,7 @@ account for missing data. For example: .. _missing_data.numeric_sum: -Sum/Prod of Empties/Nans +Sum/prod of empties/nans ~~~~~~~~~~~~~~~~~~~~~~~~ .. warning:: @@ -473,7 +473,7 @@ at the new values. .. _missing_data.interp_limits: -Interpolation Limits +Interpolation limits -------------------- Like other pandas fill methods, :meth:`~DataFrame.interpolate` accepts a ``limit`` keyword @@ -523,7 +523,7 @@ the ``limit_area`` parameter restricts filling to either inside or outside value .. _missing_data.replace: -Replacing Generic Values +Replacing generic values ~~~~~~~~~~~~~~~~~~~~~~~~ Often times we want to replace arbitrary values with other values. @@ -568,7 +568,7 @@ missing and interpolate over them: .. _missing_data.replace_expression: -String/Regular Expression Replacement +String/regular expression replacement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: @@ -664,7 +664,7 @@ want to use a regular expression. Anywhere in the above ``replace`` examples that you see a regular expression a compiled regular expression is valid as well. -Numeric Replacement +Numeric replacement ~~~~~~~~~~~~~~~~~~~ :meth:`~DataFrame.replace` is similar to :meth:`~DataFrame.fillna`. diff --git a/doc/source/user_guide/options.rst b/doc/source/user_guide/options.rst index 4d0def435cb1e..1f296c0d6c088 100644 --- a/doc/source/user_guide/options.rst +++ b/doc/source/user_guide/options.rst @@ -3,7 +3,7 @@ {{ header }} ******************** -Options and Settings +Options and settings ******************** Overview @@ -68,7 +68,7 @@ with no argument ``describe_option`` will print out the descriptions for all ava pd.reset_option("all") -Getting and Setting Options +Getting and setting options --------------------------- As described above, :func:`~pandas.get_option` and :func:`~pandas.set_option` @@ -120,10 +120,10 @@ are restored automatically when you exit the `with` block: print(pd.get_option("display.max_columns")) -Setting Startup Options in python/ipython Environment +Setting startup options in Python/IPython environment ----------------------------------------------------- -Using startup scripts for the python/ipython environment to import pandas and set options makes working with pandas more efficient. To do this, create a .py or .ipy script in the startup directory of the desired profile. An example where the startup folder is in a default ipython profile can be found at: +Using startup scripts for the Python/IPython environment to import pandas and set options makes working with pandas more efficient. To do this, create a .py or .ipy script in the startup directory of the desired profile. An example where the startup folder is in a default ipython profile can be found at: .. code-block:: none @@ -266,7 +266,7 @@ The options are 'right', and 'left'. .. _options.available: -Available Options +Available options ----------------- ======================================= ============ ================================== @@ -444,7 +444,7 @@ plotting.matplotlib.register_converters True Register custom converters .. _basics.console_output: -Number Formatting +Number formatting ------------------ pandas also allows you to set how numbers are displayed in the console. @@ -475,7 +475,7 @@ To round floats on a case-by-case basis, you can also use :meth:`~pandas.Series. .. _options.east_asian_width: -Unicode Formatting +Unicode formatting ------------------ .. warning:: @@ -538,7 +538,7 @@ However, setting this option incorrectly for your terminal will cause these char .. _options.table_schema: -Table Schema Display +Table schema display -------------------- .. versionadded:: 0.20.0 diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 8ad78a68977ad..b7b6dd0a69c24 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -3,7 +3,7 @@ {{ header }} ************************** -Reshaping and Pivot Tables +Reshaping and pivot tables ************************** Reshaping by pivoting DataFrame objects @@ -186,7 +186,7 @@ removed. .. _reshaping.stack_multiple: -Multiple Levels +Multiple levels ~~~~~~~~~~~~~~~ You may also stack or unstack more than one level at a time by passing a list @@ -214,7 +214,7 @@ not a mixture of the two). # from above is equivalent to: df.stack(level=[1, 2]) -Missing Data +Missing data ~~~~~~~~~~~~ These functions are intelligent about handling missing data and do not expect @@ -509,7 +509,7 @@ each group defined by the first two ``Series``: pd.crosstab(df.A, df.B, values=df.C, aggfunc=np.sum) -Adding Margins +Adding margins ~~~~~~~~~~~~~~ Finally, one can also add margins or normalize this output. @@ -727,7 +727,7 @@ DataFrame will be pivoted in the answers below. df -Pivoting with Single Aggregations +Pivoting with single aggregations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, @@ -775,7 +775,7 @@ and rows occur together a.k.a. "cross tabulation". To do this, we can pass df.pivot_table(index='row', columns='col', fill_value=0, aggfunc='size') -Pivoting with Multiple Aggregations +Pivoting with multiple aggregations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We can also perform multiple aggregations. For example, to perform both a diff --git a/doc/source/user_guide/sparse.rst b/doc/source/user_guide/sparse.rst index 6ee11bd78fee9..98fd30f67d05b 100644 --- a/doc/source/user_guide/sparse.rst +++ b/doc/source/user_guide/sparse.rst @@ -116,7 +116,7 @@ in many places .. _sparse.accessor: -Sparse Accessor +Sparse accessor --------------- .. versionadded:: 0.24.0 @@ -142,7 +142,7 @@ See :ref:`api.frame.sparse` for more. .. _sparse.calculation: -Sparse Calculation +Sparse calculation ------------------ You can apply NumPy `ufuncs `_ @@ -239,7 +239,7 @@ Sparse-specific properties, like ``density``, are available on the ``.sparse`` a df.sparse.density -**General Differences** +**General differences** In a ``SparseDataFrame``, *all* columns were sparse. A :class:`DataFrame` can have a mixture of sparse and dense columns. As a consequence, assigning new columns to a ``DataFrame`` with sparse @@ -370,7 +370,7 @@ row and columns coordinates of the matrix. Note that this will consume a signifi .. _sparse.subclasses: -Sparse Subclasses +Sparse subclasses ----------------- The :class:`SparseSeries` and :class:`SparseDataFrame` classes are deprecated. Visit their diff --git a/doc/source/user_guide/style.ipynb b/doc/source/user_guide/style.ipynb index 79a9848704eec..8aa1f63ecf22a 100644 --- a/doc/source/user_guide/style.ipynb +++ b/doc/source/user_guide/style.ipynb @@ -26,7 +26,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Building Styles\n", + "## Building styles\n", "\n", "Pass your style functions into one of the following methods:\n", "\n", @@ -297,7 +297,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Finer Control: Slicing" + "## Finer control: slicing" ] }, { @@ -410,7 +410,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Builtin Styles" + "## Builtin styles" ] }, { @@ -612,7 +612,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Sharing Styles" + "## Sharing styles" ] }, { @@ -754,7 +754,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Table Styles" + "### Table styles" ] }, { @@ -840,7 +840,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### CSS Classes\n", + "### CSS classes\n", "\n", "Certain CSS classes are attached to cells.\n", "\n", diff --git a/doc/source/user_guide/text.rst b/doc/source/user_guide/text.rst index 87c75e8bcd91f..4f1fcdeb62f14 100644 --- a/doc/source/user_guide/text.rst +++ b/doc/source/user_guide/text.rst @@ -3,7 +3,7 @@ {{ header }} ====================== -Working with Text Data +Working with text data ====================== .. _text.string_methods: @@ -81,7 +81,7 @@ and replacing any remaining whitespaces with underscores: exceptions, other uses are not supported, and may be disabled at a later point. -Splitting and Replacing Strings +Splitting and replacing strings ------------------------------- .. _text.split: @@ -356,7 +356,7 @@ of the string, the result will be a ``NaN``. s.str[0] s.str[1] -Extracting Substrings +Extracting substrings --------------------- .. _text.extract: @@ -518,7 +518,7 @@ same result as a ``Series.str.extractall`` with a default index (starts from 0). pd.Series(["a1a2", "b1", "c1"]).str.extractall(two_groups) -Testing for Strings that Match or Contain a Pattern +Testing for Strings that match or contain a pattern --------------------------------------------------- You can check whether elements contain a pattern: @@ -547,7 +547,7 @@ an extra ``na`` argument so missing values can be considered True or False: .. _text.indicator: -Creating Indicator Variables +Creating indicator variables ---------------------------- You can extract dummy variables from string columns. @@ -569,7 +569,7 @@ String ``Index`` also supports ``get_dummies`` which returns a ``MultiIndex``. See also :func:`~pandas.get_dummies`. -Method Summary +Method summary -------------- .. _text.summary: diff --git a/doc/source/user_guide/timedeltas.rst b/doc/source/user_guide/timedeltas.rst index 40a8fd3101409..3e46140d79b8e 100644 --- a/doc/source/user_guide/timedeltas.rst +++ b/doc/source/user_guide/timedeltas.rst @@ -5,7 +5,7 @@ .. _timedeltas.timedeltas: *********** -Time Deltas +Time deltas *********** Timedeltas are differences in times, expressed in difference units, e.g. days, hours, minutes, @@ -229,7 +229,7 @@ Numeric reduction operation for ``timedelta64[ns]`` will return ``Timedelta`` ob .. _timedeltas.timedeltas_convert: -Frequency Conversion +Frequency conversion -------------------- Timedelta Series, ``TimedeltaIndex``, and ``Timedelta`` scalars can be converted to other 'frequencies' by dividing by another timedelta, @@ -360,7 +360,7 @@ inferred frequency upon creation: pd.TimedeltaIndex(['0 days', '10 days', '20 days'], freq='infer') -Generating Ranges of Time Deltas +Generating ranges of time deltas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Similar to :func:`date_range`, you can construct regular ranges of a ``TimedeltaIndex`` diff --git a/doc/source/user_guide/timeseries.rst b/doc/source/user_guide/timeseries.rst index 7bdec001a688f..fcad6db945981 100644 --- a/doc/source/user_guide/timeseries.rst +++ b/doc/source/user_guide/timeseries.rst @@ -3,7 +3,7 @@ {{ header }} ******************************** -Time Series / Date functionality +Time series / date functionality ******************************** pandas contains extensive capabilities and features for working with time series data for all domains. @@ -183,7 +183,7 @@ future releases. .. _timeseries.converting: -Converting to Timestamps +Converting to timestamps ------------------------ To convert a :class:`Series` or list-like object of date-like objects e.g. strings, @@ -235,7 +235,7 @@ inferred frequency upon creation: pd.DatetimeIndex(['2018-01-01', '2018-01-03', '2018-01-05'], freq='infer') -Providing a Format Argument +Providing a format argument ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition to the required datetime string, a ``format`` argument can be passed to ensure specific parsing. @@ -252,7 +252,7 @@ option, see the Python `datetime documentation`_. .. _datetime documentation: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior -Assembling Datetime from Multiple DataFrame Columns +Assembling datetime from multiple DataFrame columns ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.18.1 @@ -279,7 +279,7 @@ You can pass only the columns that you need to assemble. * required: ``year``, ``month``, ``day`` * optional: ``hour``, ``minute``, ``second``, ``millisecond``, ``microsecond``, ``nanosecond`` -Invalid Data +Invalid data ~~~~~~~~~~~~ The default behavior, ``errors='raise'``, is to raise when unparseable: @@ -304,7 +304,7 @@ Pass ``errors='coerce'`` to convert unparseable data to ``NaT`` (not a time): .. _timeseries.converting.epoch: -Epoch Timestamps +Epoch timestamps ~~~~~~~~~~~~~~~~ pandas supports converting integer or float epoch times to ``Timestamp`` and @@ -356,7 +356,7 @@ as timezone-naive timestamps and then localize to the appropriate timezone: .. _timeseries.converting.epoch_inverse: -From Timestamps to Epoch +From timestamps to epoch ~~~~~~~~~~~~~~~~~~~~~~~~ To invert the operation from above, namely, to convert from a ``Timestamp`` to a 'unix' epoch: @@ -396,7 +396,7 @@ Commonly called 'unix epoch' or POSIX time. .. _timeseries.daterange: -Generating Ranges of Timestamps +Generating ranges of timestamps ------------------------------- To generate an index with timestamps, you can use either the ``DatetimeIndex`` or @@ -471,7 +471,7 @@ resulting ``DatetimeIndex``: .. _timeseries.custom-freq-ranges: -Custom Frequency Ranges +Custom frequency ranges ~~~~~~~~~~~~~~~~~~~~~~~ .. warning:: @@ -504,7 +504,7 @@ used if a custom frequency string is passed. .. _timeseries.timestamp-limits: -Timestamp Limitations +Timestamp limitations --------------------- Since pandas represents timestamps in nanosecond resolution, the time span that @@ -561,7 +561,7 @@ intelligent functionality like selection, slicing, etc. .. _timeseries.partialindexing: -Partial String Indexing +Partial string indexing ~~~~~~~~~~~~~~~~~~~~~~~ Dates and strings that parse to timestamps can be passed as indexing parameters: @@ -648,7 +648,7 @@ Slicing with string indexing also honors UTC offset. .. _timeseries.slice_vs_exact_match: -Slice vs. Exact Match +Slice vs. exact match ~~~~~~~~~~~~~~~~~~~~~ .. versionchanged:: 0.20.0 @@ -719,7 +719,7 @@ Note also that ``DatetimeIndex`` resolution cannot be less precise than day. series_monthly['2011-12'] # returns Series -Exact Indexing +Exact indexing ~~~~~~~~~~~~~~ As discussed in previous section, indexing a ``DatetimeIndex`` with a partial string depends on the "accuracy" of the period, in other words how specific the interval is in relation to the resolution of the index. In contrast, indexing with ``Timestamp`` or ``datetime`` objects is exact, because the objects have exact meaning. These also follow the semantics of *including both endpoints*. @@ -738,7 +738,7 @@ With no defaults. datetime.datetime(2013, 2, 28, 10, 12, 0)] -Truncating & Fancy Indexing +Truncating & fancy indexing ~~~~~~~~~~~~~~~~~~~~~~~~~~~ A :meth:`~DataFrame.truncate` convenience function is provided that is similar @@ -763,7 +763,7 @@ regularity will result in a ``DatetimeIndex``, although frequency is lost: .. _timeseries.components: -Time/Date Components +Time/date components -------------------- There are several time/date properties that one can access from ``Timestamp`` or a collection of timestamps like a ``DatetimeIndex``. @@ -805,7 +805,7 @@ on :ref:`.dt accessors`. .. _timeseries.offsets: -DateOffset Objects +DateOffset objects ------------------ In the preceding examples, frequency strings (e.g. ``'D'``) were used to specify @@ -922,7 +922,7 @@ in the operation). .. _relativedelta documentation: https://dateutil.readthedocs.io/en/stable/relativedelta.html -Parametric Offsets +Parametric offsets ~~~~~~~~~~~~~~~~~~ Some of the offsets can be "parameterized" when created to result in different @@ -958,7 +958,7 @@ Another example is parameterizing ``YearEnd`` with the specific ending month: .. _timeseries.offsetseries: -Using Offsets with ``Series`` / ``DatetimeIndex`` +Using offsets with ``Series`` / ``DatetimeIndex`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Offsets can be used with either a ``Series`` or ``DatetimeIndex`` to @@ -997,7 +997,7 @@ calculate significantly slower and will show a ``PerformanceWarning`` .. _timeseries.custombusinessdays: -Custom Business Days +Custom business days ~~~~~~~~~~~~~~~~~~~~ The ``CDay`` or ``CustomBusinessDay`` class provides a parametric @@ -1071,7 +1071,7 @@ in the usual way. .. _timeseries.businesshour: -Business Hour +Business hour ~~~~~~~~~~~~~ The ``BusinessHour`` class provides a business hour representation on ``BusinessDay``, @@ -1172,7 +1172,7 @@ following subsection. .. _timeseries.custombusinesshour: -Custom Business Hour +Custom business hour ~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.18.1 @@ -1205,7 +1205,7 @@ You can use keyword arguments supported by either ``BusinessHour`` and ``CustomB .. _timeseries.offset_aliases: -Offset Aliases +Offset aliases ~~~~~~~~~~~~~~ A number of string aliases are given to useful common time series @@ -1243,7 +1243,7 @@ frequencies. We will refer to these aliases as *offset aliases*. "U, us", "microseconds" "N", "nanoseconds" -Combining Aliases +Combining aliases ~~~~~~~~~~~~~~~~~ As we have seen previously, the alias and the offset instance are fungible in @@ -1263,7 +1263,7 @@ You can combine together day and intraday offsets: pd.date_range(start, periods=10, freq='1D10U') -Anchored Offsets +Anchored offsets ~~~~~~~~~~~~~~~~ For some frequencies you can specify an anchoring suffix: @@ -1308,7 +1308,7 @@ These can be used as arguments to ``date_range``, ``bdate_range``, constructors for ``DatetimeIndex``, as well as various other timeseries-related functions in pandas. -Anchored Offset Semantics +Anchored offset semantics ~~~~~~~~~~~~~~~~~~~~~~~~~ For those offsets that are anchored to the start or end of specific @@ -1356,7 +1356,7 @@ it is rolled forward to the next anchor point. .. _timeseries.holiday: -Holidays / Holiday Calendars +Holidays / holiday calendars ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Holidays and calendars provide a simple way to define holiday rules to be used @@ -1456,7 +1456,7 @@ or calendars with additional rules. Time Series-Related Instance Methods ------------------------------------ -Shifting / Lagging +Shifting / lagging ~~~~~~~~~~~~~~~~~~ One may want to *shift* or *lag* the values in a time series back and forward in @@ -1489,7 +1489,7 @@ changes all the dates in the index by a specified number of offsets: Note that with ``tshift``, the leading entry is no longer NaN because the data is not being realigned. -Frequency Conversion +Frequency conversion ~~~~~~~~~~~~~~~~~~~~ The primary function for changing frequencies is the :meth:`~Series.asfreq` @@ -1511,13 +1511,13 @@ method for any gaps that may appear after the frequency conversion. ts.asfreq(pd.offsets.BDay(), method='pad') -Filling Forward / Backward +Filling forward / backward ~~~~~~~~~~~~~~~~~~~~~~~~~~ Related to ``asfreq`` and ``reindex`` is :meth:`~Series.fillna`, which is documented in the :ref:`missing data section `. -Converting to Python Datetimes +Converting to Python datetimes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``DatetimeIndex`` can be converted to an array of Python native @@ -1654,7 +1654,7 @@ For upsampling, you can specify a way to upsample and the ``limit`` parameter to ts[:2].resample('250L').ffill(limit=2) -Sparse Resampling +Sparse resampling ~~~~~~~~~~~~~~~~~ Sparse timeseries are the ones where you have a lot fewer points relative @@ -1807,7 +1807,7 @@ See :ref:`groupby.iterating-label` or :class:`Resampler.__iter__` for more. .. _timeseries.periods: -Time Span Representation +Time span representation ------------------------ Regular intervals of time are represented by ``Period`` objects in pandas while @@ -1939,7 +1939,7 @@ objects: .. _timeseries.period_dtype: -Period Dtypes +Period dtypes ~~~~~~~~~~~~~ .. versionadded:: 0.19.0 @@ -1974,7 +1974,7 @@ The ``period`` dtype can be used in ``.astype(...)``. It allows one to change th dti.astype('period[M]') -PeriodIndex Partial String Indexing +PeriodIndex partial string indexing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can pass in dates and strings to ``Series`` and ``DataFrame`` with ``PeriodIndex``, in the same manner as ``DatetimeIndex``. For details, refer to :ref:`DatetimeIndex Partial String Indexing `. @@ -2007,7 +2007,7 @@ As with ``DatetimeIndex``, the endpoints will be included in the result. The exa dfp['2013-01-01 10H':'2013-01-01 11H'] -Frequency Conversion and Resampling with PeriodIndex +Frequency conversion and resampling with PeriodIndex ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The frequency of ``Period`` and ``PeriodIndex`` can be converted via the ``asfreq`` method. Let's start with the fiscal year 2011, ending in December: @@ -2078,7 +2078,7 @@ frequencies ``Q-JAN`` through ``Q-DEC``. .. _timeseries.interchange: -Converting Between Representations +Converting between representations ---------------------------------- Timestamped data can be converted to PeriodIndex-ed data using ``to_period`` @@ -2122,7 +2122,7 @@ the quarter end: .. _timeseries.oob: -Representing Out-of-Bounds Spans +Representing out-of-bounds spans -------------------------------- If you have data that is outside of the ``Timestamp`` bounds, see :ref:`Timestamp limitations `, @@ -2156,7 +2156,7 @@ These can easily be converted to a ``PeriodIndex``: .. _timeseries.timezone: -Time Zone Handling +Time zone handling ------------------ pandas provides rich support for working with timestamps in different time @@ -2164,7 +2164,7 @@ zones using the ``pytz`` and ``dateutil`` libraries or class:`datetime.timezone` objects from the standard library. -Working with Time Zones +Working with time zones ~~~~~~~~~~~~~~~~~~~~~~~ By default, pandas objects are time zone unaware: @@ -2320,7 +2320,7 @@ To remove time zone information, use ``tz_localize(None)`` or ``tz_convert(None) .. _timeseries.timezone_ambiguous: -Ambiguous Times when Localizing +Ambiguous times when localizing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``tz_localize`` may not be able to determine the UTC offset of a timestamp @@ -2354,7 +2354,7 @@ Handle these ambiguous times by specifying the following. .. _timeseries.timezone_nonexistent: -Nonexistent Times when Localizing +Nonexistent times when localizing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A DST transition may also shift the local time ahead by 1 hour creating nonexistent @@ -2392,7 +2392,7 @@ Transform nonexistent times to ``NaT`` or shift the times. .. _timeseries.timezone_series: -Time Zone Series Operations +Time zone series operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~ A :class:`Series` with time zone **naive** values is diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 2448d0e5d9930..6589900c8491c 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -23,7 +23,7 @@ libraries that go beyond the basics documented here. .. _visualization.basic: -Basic Plotting: ``plot`` +Basic plotting: ``plot`` ------------------------ We will demonstrate the basics, see the :ref:`cookbook` for @@ -97,7 +97,7 @@ You can plot one column versus another using the `x` and `y` keywords in .. _visualization.other: -Other Plots +Other plots ----------- Plotting methods allow for a handful of plot styles other than the @@ -311,7 +311,7 @@ The ``by`` keyword can be specified to plot grouped histograms: .. _visualization.box: -Box Plots +Box plots ~~~~~~~~~ Boxplot can be drawn calling :meth:`Series.plot.box` and :meth:`DataFrame.plot.box`, @@ -495,7 +495,7 @@ then by the numeric columns. .. _visualization.area_plot: -Area Plot +Area plot ~~~~~~~~~ You can create area plots with :meth:`Series.plot.area` and :meth:`DataFrame.plot.area`. @@ -531,7 +531,7 @@ To produce an unstacked plot, pass ``stacked=False``. Alpha value is set to 0.5 .. _visualization.scatter: -Scatter Plot +Scatter plot ~~~~~~~~~~~~ Scatter plot can be drawn by using the :meth:`DataFrame.plot.scatter` method. @@ -599,7 +599,7 @@ See the :meth:`scatter ` method and the .. _visualization.hexbin: -Hexagonal Bin Plot +Hexagonal bin plot ~~~~~~~~~~~~~~~~~~ You can create hexagonal bin plots with :meth:`DataFrame.plot.hexbin`. @@ -762,7 +762,7 @@ See the `matplotlib pie documentation `). These can be used to control additional styling, beyond what pandas provides. -Controlling the Legend +Controlling the legend ~~~~~~~~~~~~~~~~~~~~~~ You may set the ``legend`` argument to ``False`` to hide the legend, which is @@ -1140,7 +1140,7 @@ You may pass ``logy`` to get a log-scale Y axis. See also the ``logx`` and ``loglog`` keyword arguments. -Plotting on a Secondary Y-axis +Plotting on a secondary y-axis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To plot data on a secondary y-axis, use the ``secondary_y`` keyword: @@ -1194,7 +1194,7 @@ with "(right)" in the legend. To turn off the automatic marking, use the plt.close('all') -Suppressing Tick Resolution Adjustment +Suppressing tick resolution adjustment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pandas includes automatic tick resolution adjustment for regular frequency @@ -1248,7 +1248,7 @@ in ``pandas.plotting.plot_params`` can be used in a `with statement`: plt.close('all') -Automatic Date Tick Adjustment +Automatic date tick adjustment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.20.0 @@ -1276,7 +1276,7 @@ with the ``subplots`` keyword: plt.close('all') -Using Layout and Targeting Multiple Axes +Using layout and targeting multiple axes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The layout of subplots can be specified by the ``layout`` keyword. It can accept @@ -1377,7 +1377,7 @@ Another option is passing an ``ax`` argument to :meth:`Series.plot` to plot on a .. _visualization.errorbars: -Plotting With Error Bars +Plotting with error bars ~~~~~~~~~~~~~~~~~~~~~~~~ Plotting with error bars is supported in :meth:`DataFrame.plot` and :meth:`Series.plot`. @@ -1423,7 +1423,7 @@ Here is an example of one way to easily plot group means with standard deviation .. _visualization.table: -Plotting Tables +Plotting tables ~~~~~~~~~~~~~~~ Plotting with matplotlib table is now supported in :meth:`DataFrame.plot` and :meth:`Series.plot` with a ``table`` keyword. The ``table`` keyword can accept ``bool``, :class:`DataFrame` or :class:`Series`. The simple way to draw a table is to specify ``table=True``. Data will be transposed to meet matplotlib's default layout. diff --git a/doc/source/whatsnew/v0.10.0.rst b/doc/source/whatsnew/v0.10.0.rst index 9d497f2fc658d..59ea6b9776232 100644 --- a/doc/source/whatsnew/v0.10.0.rst +++ b/doc/source/whatsnew/v0.10.0.rst @@ -255,7 +255,7 @@ Convenience methods ``ffill`` and ``bfill`` have been added: New features ~~~~~~~~~~~~ -Wide DataFrame Printing +Wide DataFrame printing ~~~~~~~~~~~~~~~~~~~~~~~ Instead of printing the summary information, pandas now splits the string @@ -290,7 +290,7 @@ The width of each line can be changed via 'line_width' (80 by default): wide_frame -Updated PyTables Support +Updated PyTables support ~~~~~~~~~~~~~~~~~~~~~~~~ :ref:`Docs ` for PyTables ``Table`` format & several enhancements to the api. Here is a taste of what to expect. @@ -490,7 +490,7 @@ Updated PyTables Support however, query terms using the prior (undocumented) methodology are unsupported. You must read in the entire file and write it out using the new format to take advantage of the updates. -N Dimensional Panels (Experimental) +N dimensional Panels (experimental) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adding experimental support for Panel4D and factory functions to create n-dimensional named panels. diff --git a/doc/source/whatsnew/v0.11.0.rst b/doc/source/whatsnew/v0.11.0.rst index 0dfcfca9a7464..31fab6c9aeb74 100644 --- a/doc/source/whatsnew/v0.11.0.rst +++ b/doc/source/whatsnew/v0.11.0.rst @@ -20,7 +20,7 @@ of useful recipes in pandas (and that we want contributions!). There are several libraries that are now :ref:`Recommended Dependencies ` -Selection Choices +Selection choices ~~~~~~~~~~~~~~~~~ Starting in 0.11.0, object selection has had a number of user-requested additions in @@ -56,7 +56,7 @@ three types of multi-axis indexing. See more at :ref:`Advanced Indexing ` and :ref:`Advanced Hierarchical `. -Selection Deprecations +Selection deprecations ~~~~~~~~~~~~~~~~~~~~~~ Starting in version 0.11.0, these methods *may* be deprecated in future versions. @@ -88,7 +88,7 @@ Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passe df3 df3.dtypes -Dtype Conversion +Dtype conversion ~~~~~~~~~~~~~~~~ This is lower-common-denominator upcasting, meaning you get the dtype which can accommodate all of the types @@ -103,7 +103,7 @@ Conversion df3.astype('float32').dtypes -Mixed Conversion +Mixed conversion .. code-block:: ipython @@ -134,7 +134,7 @@ Mixed Conversion E int32 dtype: object -Forcing Date coercion (and setting ``NaT`` when not datelike) +Forcing date coercion (and setting ``NaT`` when not datelike) .. code-block:: ipython @@ -154,10 +154,10 @@ Forcing Date coercion (and setting ``NaT`` when not datelike) 5 2001-01-05 dtype: datetime64[ns] -Dtype Gotchas +Dtype gotchas ~~~~~~~~~~~~~ -**Platform Gotchas** +**Platform gotchas** Starting in 0.11.0, construction of DataFrame/Series will use default dtypes of ``int64`` and ``float64``, *regardless of platform*. This is not an apparent change from earlier versions of pandas. If you specify @@ -185,7 +185,7 @@ The following will all result in ``int64`` dtypes Keep in mind that ``DataFrame(np.array([1,2]))`` **WILL** result in ``int32`` on 32-bit platforms! -**Upcasting Gotchas** +**Upcasting gotchas** Performing indexing operations on integer type data can easily upcast the data. The dtype of the input data will be preserved in cases where ``nans`` are not introduced. @@ -280,7 +280,7 @@ While float dtypes are unchanged. E int32 dtype: object -Datetimes Conversion +Datetimes conversion ~~~~~~~~~~~~~~~~~~~~ Datetime64[ns] columns in a DataFrame (or a Series) allow the use of ``np.nan`` to indicate a nan value, diff --git a/doc/source/whatsnew/v0.12.0.rst b/doc/source/whatsnew/v0.12.0.rst index ff549f10a97c3..0a74d67486715 100644 --- a/doc/source/whatsnew/v0.12.0.rst +++ b/doc/source/whatsnew/v0.12.0.rst @@ -177,7 +177,7 @@ API changes ``__repr__``). Plus string safety throughout. Now employed in many places throughout the pandas library. (:issue:`4090`, :issue:`4092`) -I/O Enhancements +I/O enhancements ~~~~~~~~~~~~~~~~ - ``pd.read_html()`` can now parse HTML strings, files or urls and return @@ -282,7 +282,7 @@ I/O Enhancements - ``read_csv`` will now throw a more informative error message when a file contains no columns, e.g., all newline characters -Other Enhancements +Other enhancements ~~~~~~~~~~~~~~~~~~ - ``DataFrame.replace()`` now allows regular expressions on contained @@ -371,7 +371,7 @@ Other Enhancements is detected (:issue:`4214`) -Experimental Features +Experimental features ~~~~~~~~~~~~~~~~~~~~~ - Added experimental ``CustomBusinessDay`` class to support ``DateOffsets`` @@ -398,7 +398,7 @@ Experimental Features dts = pd.date_range(dt, periods=5, freq=bday_egypt) print(pd.Series(dts.weekday, dts).map(pd.Series('Mon Tue Wed Thu Fri Sat Sun'.split()))) -Bug Fixes +Bug fixes ~~~~~~~~~ - Plotting functions now raise a ``TypeError`` before trying to plot anything diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index 095d1807ca873..0614de82cbcd0 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -203,7 +203,7 @@ API changes - ``Series.argmin`` and ``Series.argmax`` are now aliased to ``Series.idxmin`` and ``Series.idxmax``. These return the *index* of the min or max element respectively. Prior to 0.13.0 these would return the position of the min / max element. (:issue:`6214`) -Prior Version Deprecations/Changes +Prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These were announced changes in 0.12 or prior that are taking effect as of 0.13.0 @@ -234,7 +234,7 @@ Deprecated in 0.13.0 behavior is the default, but the new behavior is available through the keyword argument ``as_indexer=True``. -Indexing API Changes +Indexing API changes ~~~~~~~~~~~~~~~~~~~~ Prior to 0.13, it was impossible to use a label indexer (``.loc/.ix``) to set a value that @@ -305,7 +305,7 @@ A Panel setting operation on an arbitrary axis aligns the input to the Panel 2001-01-14 30.0 32.0 2001-01-15 30.0 32.0 -Float64Index API Change +Float64Index API change ~~~~~~~~~~~~~~~~~~~~~~~ - Added a new index type, ``Float64Index``. This will be automatically created when passing floating values in index creation. @@ -369,7 +369,7 @@ Float64Index API Change In [3]: pd.Series(range(5))[3.0] Out[3]: 3 -HDFStore API Changes +HDFStore API changes ~~~~~~~~~~~~~~~~~~~~ - Query Format Changes. A much more string-like query format is now supported. See :ref:`the docs`. @@ -468,7 +468,7 @@ HDFStore API Changes via the option ``io.hdf.dropna_table`` (:issue:`4625`) - pass through store creation arguments; can be used to support in-memory stores -DataFrame repr Changes +DataFrame repr changes ~~~~~~~~~~~~~~~~~~~~~~ The HTML and plain text representations of :class:`DataFrame` now show @@ -915,7 +915,7 @@ Experimental .. _whatsnew_0130.refactoring: -Internal Refactoring +Internal refactoring ~~~~~~~~~~~~~~~~~~~~ In 0.13.0 there is a major refactor primarily to subclass ``Series`` from @@ -1030,7 +1030,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. _release.bug_fixes-0.13.0: -Bug Fixes +Bug fixes ~~~~~~~~~ - ``HDFStore`` diff --git a/doc/source/whatsnew/v0.13.1.rst b/doc/source/whatsnew/v0.13.1.rst index 161b0ef395f05..6242c40d44bf8 100644 --- a/doc/source/whatsnew/v0.13.1.rst +++ b/doc/source/whatsnew/v0.13.1.rst @@ -43,7 +43,7 @@ Highlights include: df.loc[0, 'A'] = np.nan df -Output Formatting Enhancements +Output formatting enhancements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - df.info() view now display dtype info per column (:issue:`5682`) @@ -179,7 +179,7 @@ API changes [0 rows x 2 columns] -Prior Version Deprecations/Changes +Prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are no announced changes in 0.13 or prior that are taking effect as of 0.13.1 @@ -394,7 +394,7 @@ There are no experimental changes in 0.13.1 .. _release.bug_fixes-0.13.1: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in ``io.wb.get_countries`` not including all countries (:issue:`6008`) diff --git a/doc/source/whatsnew/v0.14.0.rst b/doc/source/whatsnew/v0.14.0.rst index f049006808c0f..25a75492d78fb 100644 --- a/doc/source/whatsnew/v0.14.0.rst +++ b/doc/source/whatsnew/v0.14.0.rst @@ -245,7 +245,7 @@ API changes .. _whatsnew_0140.display: -Display Changes +Display changes ~~~~~~~~~~~~~~~ - The default way of printing large DataFrames has changed. DataFrames @@ -301,7 +301,7 @@ Display Changes .. _whatsnew_0140.parsing: -Text Parsing API Changes +Text parsing API changes ~~~~~~~~~~~~~~~~~~~~~~~~ :func:`read_csv`/:func:`read_table` will now be noisier w.r.t invalid options rather than falling back to the ``PythonParser``. @@ -321,10 +321,10 @@ Text Parsing API Changes .. _whatsnew_0140.groupby: -Groupby API Changes +Groupby API changes ~~~~~~~~~~~~~~~~~~~ -More consistent behaviour for some groupby methods: +More consistent behavior for some groupby methods: - groupby ``head`` and ``tail`` now act more like ``filter`` rather than an aggregation: @@ -473,7 +473,7 @@ Some other enhancements to the sql functions include: .. _whatsnew_0140.slicers: -MultiIndexing Using Slicers +MultiIndexing using slicers ~~~~~~~~~~~~~~~~~~~~~~~~~~~ In 0.14.0 we added a new way to slice MultiIndexed objects. @@ -625,7 +625,7 @@ Plotting .. _whatsnew_0140.prior_deprecations: -Prior Version Deprecations/Changes +Prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are prior version deprecations that are taking effect as of 0.14.0. @@ -731,7 +731,7 @@ Deprecations .. _whatsnew_0140.knownissues: -Known Issues +Known issues ~~~~~~~~~~~~ - OpenPyXL 2.0.0 breaks backwards compatibility (:issue:`7169`) diff --git a/doc/source/whatsnew/v0.14.1.rst b/doc/source/whatsnew/v0.14.1.rst index fcfb22d074554..26018c5745a11 100644 --- a/doc/source/whatsnew/v0.14.1.rst +++ b/doc/source/whatsnew/v0.14.1.rst @@ -169,7 +169,7 @@ Experimental .. _whatsnew_0141.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in ``DataFrame.where`` with a symmetric shaped frame and a passed other of a DataFrame (:issue:`7506`) - Bug in Panel indexing with a MultiIndex axis (:issue:`7516`) diff --git a/doc/source/whatsnew/v0.15.0.rst b/doc/source/whatsnew/v0.15.0.rst index f9e47b45f498d..bea2ce815d243 100644 --- a/doc/source/whatsnew/v0.15.0.rst +++ b/doc/source/whatsnew/v0.15.0.rst @@ -220,7 +220,7 @@ Finally, the combination of ``TimedeltaIndex`` with ``DatetimeIndex`` allow cert .. _whatsnew_0150.memory: -Memory Usage +Memory usage ^^^^^^^^^^^^ Implemented methods to find memory usage of a DataFrame. See the :ref:`FAQ ` for more. (:issue:`6852`). @@ -339,7 +339,7 @@ Timezone handling improvements .. _whatsnew_0150.roll: -Rolling/Expanding Moments improvements +Rolling/expanding moments improvements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - :func:`rolling_min`, :func:`rolling_max`, :func:`rolling_cov`, and :func:`rolling_corr` @@ -879,7 +879,7 @@ Other notable API changes: .. _whatsnew_0150.refactoring: -Internal Refactoring +Internal refactoring ^^^^^^^^^^^^^^^^^^^^ In 0.15.0 ``Index`` has internally been refactored to no longer sub-class ``ndarray`` @@ -1109,7 +1109,7 @@ Performance .. _whatsnew_0150.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in pivot_table, when using margins and a dict aggfunc (:issue:`8349`) diff --git a/doc/source/whatsnew/v0.15.1.rst b/doc/source/whatsnew/v0.15.1.rst index 1091944cb056f..2e036267b5804 100644 --- a/doc/source/whatsnew/v0.15.1.rst +++ b/doc/source/whatsnew/v0.15.1.rst @@ -275,7 +275,7 @@ Enhancements .. _whatsnew_0151.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in unpickling of a ``CustomBusinessDay`` object (:issue:`8591`) diff --git a/doc/source/whatsnew/v0.15.2.rst b/doc/source/whatsnew/v0.15.2.rst index 9f0449d6a1754..a41ad5bdf8cd6 100644 --- a/doc/source/whatsnew/v0.15.2.rst +++ b/doc/source/whatsnew/v0.15.2.rst @@ -191,7 +191,7 @@ Performance .. _whatsnew_0152.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in concat of Series with ``category`` dtype which were coercing to ``object``. (:issue:`8641`) diff --git a/doc/source/whatsnew/v0.16.0.rst b/doc/source/whatsnew/v0.16.0.rst index 2cb09325c9466..b903c4dae4c5a 100644 --- a/doc/source/whatsnew/v0.16.0.rst +++ b/doc/source/whatsnew/v0.16.0.rst @@ -39,7 +39,7 @@ New features .. _whatsnew_0160.enhancements.assign: -DataFrame Assign +DataFrame assign ^^^^^^^^^^^^^^^^ Inspired by `dplyr's @@ -135,7 +135,7 @@ from a ``scipy.sparse.coo_matrix``: .. _whatsnew_0160.enhancements.string: -String Methods Enhancements +String methods enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Following new methods are accessible via ``.str`` accessor to apply the function to each values. This is intended to make it more consistent with standard methods on strings. (:issue:`9282`, :issue:`9352`, :issue:`9386`, :issue:`9387`, :issue:`9439`) @@ -228,7 +228,7 @@ sub-class of ``datetime.timedelta``. Mentioned :ref:`here `, the following @@ -279,7 +279,7 @@ enhancements make string operations easier and more consistent with standard pyt .. _whatsnew_0161.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - ``BusinessHour`` offset is now supported, which represents business hours starting from 09:00 - 17:00 on ``BusinessDay`` by default. See :ref:`Here ` for details. (:issue:`7905`) @@ -351,12 +351,12 @@ Deprecations .. _whatsnew_0161.index_repr: -Index Representation +Index representation ~~~~~~~~~~~~~~~~~~~~ The string representation of ``Index`` and its sub-classes have now been unified. These will show a single-line display if there are few values; a wrapped multi-line display for a lot of values (but less than ``display.max_seq_items``; if lots of items (> ``display.max_seq_items``) will show a truncated display (the head and tail of the data). The formatting for ``MultiIndex`` is unchanged (a multi-line wrapped display). The display width responds to the option ``display.max_seq_items``, which is defaulted to 100. (:issue:`6482`) -Previous Behavior +Previous behavior .. code-block:: ipython @@ -378,7 +378,7 @@ Previous Behavior [2013-01-01 00:00:00-05:00, ..., 2013-04-14 00:00:00-04:00] Length: 104, Freq: D, Timezone: US/Eastern -New Behavior +New behavior .. ipython:: python @@ -399,7 +399,7 @@ New Behavior .. _whatsnew_0161.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved csv write performance with mixed dtypes, including datetimes by up to 5x (:issue:`9940`) @@ -409,7 +409,7 @@ Performance Improvements .. _whatsnew_0161.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug where labels did not appear properly in the legend of ``DataFrame.plot()``, passing ``label=`` arguments works, and Series indices are no longer mutated. (:issue:`9542`) diff --git a/doc/source/whatsnew/v0.16.2.rst b/doc/source/whatsnew/v0.16.2.rst index ca0ad8d3ae7f9..543f9c6bbf300 100644 --- a/doc/source/whatsnew/v0.16.2.rst +++ b/doc/source/whatsnew/v0.16.2.rst @@ -86,7 +86,7 @@ See the :ref:`documentation ` for more. (:issue:`10129`) .. _whatsnew_0162.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - Added `rsplit` to Index/Series StringMethods (:issue:`10303`) @@ -105,7 +105,7 @@ Other Enhancements .. _whatsnew_0162.api: -API Changes +API changes ~~~~~~~~~~~ - ``Holiday`` now raises ``NotImplementedError`` if both ``offset`` and ``observance`` are used in the constructor instead of returning an incorrect result (:issue:`10217`). @@ -113,7 +113,7 @@ API Changes .. _whatsnew_0162.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved ``Series.resample`` performance with ``dtype=datetime64[ns]`` (:issue:`7754`) @@ -121,7 +121,7 @@ Performance Improvements .. _whatsnew_0162.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in ``Series.hist`` raises an error when a one row ``Series`` was given (:issue:`10214`) diff --git a/doc/source/whatsnew/v0.17.0.rst b/doc/source/whatsnew/v0.17.0.rst index 8a3f87e8488ca..67abad659dc8d 100644 --- a/doc/source/whatsnew/v0.17.0.rst +++ b/doc/source/whatsnew/v0.17.0.rst @@ -103,7 +103,7 @@ This uses a new-dtype representation as well, that is very similar in look-and-f There is a slightly different string repr for the underlying ``DatetimeIndex`` as a result of the dtype changes, but functionally these are the same. - Previous Behavior: + Previous behavior: .. code-block:: ipython @@ -115,7 +115,7 @@ This uses a new-dtype representation as well, that is very similar in look-and-f In [2]: pd.date_range('20130101', periods=3, tz='US/Eastern').dtype Out[2]: dtype('` for more details. .. _whatsnew_0170.matheval: -Support for Math Functions in .eval() +Support for math functions in .eval() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :meth:`~pandas.eval` now supports calling math functions (:issue:`4893`) @@ -329,7 +329,7 @@ has been changed to make this keyword unnecessary - the change is shown below. .. _whatsnew_0170.gbq: -Google BigQuery Enhancements +Google BigQuery enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Added ability to automatically create a table/dataset using the :func:`pandas.io.gbq.to_gbq` function if the destination table/dataset does not exist. (:issue:`8325`, :issue:`11121`). - Added ability to replace an existing table and schema when calling the :func:`pandas.io.gbq.to_gbq` function via the ``if_exists`` argument. See the `docs `__ for more details (:issue:`8325`). @@ -339,7 +339,7 @@ Google BigQuery Enhancements .. _whatsnew_0170.east_asian_width: -Display Alignment with Unicode East Asian Width +Display alignment with Unicode East Asian width ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. warning:: @@ -411,7 +411,7 @@ Other enhancements bar = pd.Series([1, 2]) baz = pd.Series([4, 5]) - Previous Behavior: + Previous behavior: .. code-block:: ipython @@ -421,7 +421,7 @@ Other enhancements 0 1 1 4 1 2 2 5 - New Behavior: + New behavior: .. ipython:: python @@ -609,14 +609,14 @@ In prior versions it was ``errors='ignore'``. Furthermore, the ``coerce`` argume has been deprecated in favor of ``errors='coerce'``. This means that invalid parsing will raise rather that return the original input as in previous versions. (:issue:`10636`) -Previous Behavior: +Previous behavior: .. code-block:: ipython In [2]: pd.to_datetime(['2009-07-31', 'asd']) Out[2]: array(['2009-07-31', 'asd'], dtype=object) -New Behavior: +New behavior: .. code-block:: ipython @@ -638,7 +638,7 @@ To keep the previous behavior, you can use ``errors='ignore'``: Furthermore, ``pd.to_timedelta`` has gained a similar API, of ``errors='raise'|'ignore'|'coerce'``, and the ``coerce`` keyword has been deprecated in favor of ``errors='coerce'``. -Consistent Parsing +Consistent parsing """""""""""""""""" The string parsing of ``to_datetime``, ``Timestamp`` and ``DatetimeIndex`` has @@ -648,7 +648,7 @@ Prior to v0.17.0, ``Timestamp`` and ``to_datetime`` may parse year-only datetime uses the beginning of the year. ``Timestamp`` and ``to_datetime`` may raise ``ValueError`` in some types of datetime-string which ``DatetimeIndex`` can parse, such as a quarterly string. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -663,7 +663,7 @@ Previous Behavior: v0.17.0 can parse them as below. It works on ``DatetimeIndex`` also. -New Behavior: +New behavior: .. ipython:: python @@ -681,7 +681,7 @@ New Behavior: pd.Timestamp.now() pd.Timestamp.now() + offsets.DateOffset(years=1) -Changes to Index Comparisons +Changes to Index comparisons ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Operator equal on ``Index`` should behavior similarly to ``Series`` (:issue:`9947`, :issue:`10637`) @@ -689,7 +689,7 @@ Operator equal on ``Index`` should behavior similarly to ``Series`` (:issue:`994 Starting in v0.17.0, comparing ``Index`` objects of different lengths will raise a ``ValueError``. This is to be consistent with the behavior of ``Series``. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -702,7 +702,7 @@ Previous Behavior: In [4]: pd.Index([1, 2, 3]) == pd.Index([1, 2]) Out[4]: False -New Behavior: +New behavior: .. code-block:: ipython @@ -729,7 +729,7 @@ or it can return False if broadcasting can not be done: np.array([1, 2, 3]) == np.array([1, 2]) -Changes to Boolean Comparisons vs. None +Changes to boolean comparisons vs. None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to comparing with ``np.nan``, rather than raise ``TypeError``. (:issue:`1079`). @@ -740,14 +740,14 @@ Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to compar s.iloc[1] = None s -Previous Behavior: +Previous behavior: .. code-block:: ipython In [5]: s == None TypeError: Could not compare type with Series -New Behavior: +New behavior: .. ipython:: python @@ -776,7 +776,7 @@ HDFStore dropna behavior The default behavior for HDFStore write functions with ``format='table'`` is now to keep rows that are all missing. Previously, the behavior was to drop rows that were all missing save the index. The previous behavior can be replicated using the ``dropna=True`` option. (:issue:`9382`) -Previous Behavior: +Previous behavior: .. ipython:: python @@ -802,7 +802,7 @@ Previous Behavior: 2 2 NaN -New Behavior: +New behavior: .. ipython:: python @@ -882,7 +882,7 @@ Changes to ``Categorical.unique`` cat cat.unique() -Changes to ``bool`` passed as ``header`` in Parsers +Changes to ``bool`` passed as ``header`` in parsers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In earlier versions of pandas, if a bool was passed the ``header`` argument of @@ -901,7 +901,7 @@ A ``bool`` input to ``header`` will now raise a ``TypeError`` .. _whatsnew_0170.api_breaking.other: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - Line and kde plot with ``subplots=True`` now uses default colors, not all black. Specify ``color='k'`` to draw all lines in black (:issue:`9894`) @@ -1016,7 +1016,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0170.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Development support for benchmarking with the `Air Speed Velocity library `_ (:issue:`8361`) @@ -1039,7 +1039,7 @@ Performance Improvements .. _whatsnew_0170.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in incorrect computation of ``.mean()`` on ``timedelta64[ns]`` because of overflow (:issue:`9442`) diff --git a/doc/source/whatsnew/v0.17.1.rst b/doc/source/whatsnew/v0.17.1.rst index 9de49699b9652..55080240f2a55 100644 --- a/doc/source/whatsnew/v0.17.1.rst +++ b/doc/source/whatsnew/v0.17.1.rst @@ -31,7 +31,7 @@ New features .. _whatsnew_0171.style: -Conditional HTML Formatting +Conditional HTML formatting ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. warning:: @@ -135,7 +135,7 @@ Deprecations .. _whatsnew_0171.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Checking monotonic-ness before sorting on an index (:issue:`11080`) @@ -152,7 +152,7 @@ Performance Improvements .. _whatsnew_0171.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - ``SparseArray.__iter__()`` now does not cause ``PendingDeprecationWarning`` in Python 3.5 (:issue:`11622`) diff --git a/doc/source/whatsnew/v0.18.0.rst b/doc/source/whatsnew/v0.18.0.rst index 9ff6ad7188f5a..a7174c6325f86 100644 --- a/doc/source/whatsnew/v0.18.0.rst +++ b/doc/source/whatsnew/v0.18.0.rst @@ -62,7 +62,7 @@ Window functions have been refactored to be methods on ``Series/DataFrame`` obje df = pd.DataFrame({'A': range(10), 'B': np.random.randn(10)}) df -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -82,7 +82,7 @@ Previous Behavior: 8 7 0.079587 9 8 -0.954504 -New Behavior: +New behavior: .. ipython:: python @@ -145,14 +145,14 @@ This continues to work as before for function or dict-like values. .. _whatsnew_0180.enhancements.rangeindex: -Range Index +Range index ^^^^^^^^^^^ A ``RangeIndex`` has been added to the ``Int64Index`` sub-classes to support a memory saving alternative for common use cases. This has a similar implementation to the python ``range`` object (``xrange`` in python 2), in that it only stores the start, stop, and step values for the index. It will transparently interact with the user API, converting to ``Int64Index`` if needed. This will now be the default constructed index for ``NDFrame`` objects, rather than previous an ``Int64Index``. (:issue:`939`, :issue:`12070`, :issue:`12071`, :issue:`12109`, :issue:`12888`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -168,7 +168,7 @@ Previous Behavior: Out[6]: 8000 -New Behavior: +New behavior: .. ipython:: python @@ -341,13 +341,13 @@ In addition, ``.round()``, ``.floor()`` and ``.ceil()`` will be available throug s s.dt.round('D') -Formatting of Integers in FloatIndex +Formatting of integers in FloatIndex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Integers in ``FloatIndex``, e.g. 1., are now formatted with a decimal point and a ``0`` digit, e.g. ``1.0`` (:issue:`11713`) This change not only affects the display to the console, but also the output of IO methods like ``.to_csv`` or ``.to_html``. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -369,7 +369,7 @@ Previous Behavior: 2,3 -New Behavior: +New behavior: .. ipython:: python @@ -383,7 +383,7 @@ Changes to dtype assignment behaviors When a DataFrame's slice is updated with a new slice of the same dtype, the dtype of the DataFrame will now remain the same. (:issue:`10503`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -406,7 +406,7 @@ Previous Behavior: b int64 dtype: object -New Behavior: +New behavior: .. ipython:: python @@ -419,7 +419,7 @@ New Behavior: When a DataFrame's integer slice is partially updated with a new slice of floats that could potentially be down-casted to integer without losing precision, the dtype of the slice will be set to float instead of integer. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -443,7 +443,7 @@ Previous Behavior: 10 4 5 1 8 12 7 8 9 -New Behavior: +New behavior: .. ipython:: python @@ -484,7 +484,7 @@ See the `xarray full-documentation here `__ * major_axis (major_axis) int64 0 1 2 * minor_axis (minor_axis) int64 0 1 2 3 -Latex Representation +Latex representation ^^^^^^^^^^^^^^^^^^^^ ``DataFrame`` has gained a ``._repr_latex_()`` method in order to allow for conversion to latex in a ipython/jupyter notebook using nbconvert. (:issue:`11778`) @@ -981,7 +981,7 @@ assignments are valid for multi-line expressions. .. _whatsnew_0180.api: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - ``DataFrame.between_time`` and ``Series.between_time`` now only parse a fixed set of time strings. Parsing of date strings is no longer supported and raises a ``ValueError``. (:issue:`11818`) @@ -1074,7 +1074,7 @@ In 0.18.0, this deprecation warning is removed and these will now raise a ``Type s2 = pd.Series([1, 2, 3], index=list('abc')) s2 -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -1104,7 +1104,7 @@ Previous Behavior: c 3 dtype: int64 -New Behavior: +New behavior: For iloc, getting & setting via a float scalar will always raise. @@ -1180,7 +1180,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0180.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of ``andrews_curves`` (:issue:`11534`) diff --git a/doc/source/whatsnew/v0.18.1.rst b/doc/source/whatsnew/v0.18.1.rst index 069395c2e0f36..7e06e5050c5f0 100644 --- a/doc/source/whatsnew/v0.18.1.rst +++ b/doc/source/whatsnew/v0.18.1.rst @@ -31,7 +31,7 @@ New features .. _whatsnew_0181.enhancements.custombusinesshour: -Custom Business Hour +Custom business hour ^^^^^^^^^^^^^^^^^^^^ The ``CustomBusinessHour`` is a mixture of ``BusinessHour`` and ``CustomBusinessDay`` which @@ -199,7 +199,7 @@ On other levels .. _whatsnew_0181.enhancements.assembling: -Assembling Datetimes +Assembling datetimes ^^^^^^^^^^^^^^^^^^^^ ``pd.to_datetime()`` has gained the ability to assemble datetimes from a passed in ``DataFrame`` or a dict. (:issue:`8158`). @@ -226,7 +226,7 @@ You can pass only the columns that you need to assemble. .. _whatsnew_0181.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - ``pd.read_csv()`` now supports ``delim_whitespace=True`` for the Python engine (:issue:`12958`) @@ -317,7 +317,7 @@ The index in ``.groupby(..).nth()`` output is now more consistent when the ``as_ 'B': [1, 2, 3]}) df -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -333,7 +333,7 @@ Previous Behavior: 1 2 Name: B, dtype: int64 -New Behavior: +New behavior: .. ipython:: python @@ -348,7 +348,7 @@ Furthermore, previously, a ``.groupby`` would always sort, regardless if ``sort= df = pd.DataFrame(np.random.randn(100, 2), columns=['a', 'b']) df['c'] = np.random.randint(0, 4, 100) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -370,7 +370,7 @@ Previous Behavior: 2 -0.720589 0.887163 3 0.859588 -0.636524 -New Behavior: +New behavior: .. ipython:: python @@ -446,7 +446,7 @@ Previous behavior: 2000-11-30 value 13 dtype: int64 -New Behavior: +New behavior: .. code-block:: ipython @@ -580,7 +580,7 @@ Deprecations .. _whatsnew_0181.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved speed of SAS reader (:issue:`12656`, :issue:`12961`) @@ -601,7 +601,7 @@ Performance Improvements .. _whatsnew_0181.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - ``usecols`` parameter in ``pd.read_csv`` is now respected even when the lines of a CSV file are not even (:issue:`12203`) - Bug in ``groupby.transform(..)`` when ``axis=1`` is specified with a non-monotonic ordered index (:issue:`12713`) diff --git a/doc/source/whatsnew/v0.19.0.rst b/doc/source/whatsnew/v0.19.0.rst index fe9fdd7448923..52ea9e8839e45 100644 --- a/doc/source/whatsnew/v0.19.0.rst +++ b/doc/source/whatsnew/v0.19.0.rst @@ -264,7 +264,7 @@ Individual columns can be parsed as a ``Categorical`` using a dict specification .. _whatsnew_0190.enhancements.union_categoricals: -Categorical Concatenation +Categorical concatenation ^^^^^^^^^^^^^^^^^^^^^^^^^ - A function :func:`union_categoricals` has been added for combining categoricals, see :ref:`Unioning Categoricals` (:issue:`13361`, :issue:`13763`, :issue:`13846`, :issue:`14173`) @@ -298,7 +298,7 @@ Categorical Concatenation .. _whatsnew_0190.enhancements.semi_month_offsets: -Semi-Month Offsets +Semi-month offsets ^^^^^^^^^^^^^^^^^^ Pandas has gained new frequency offsets, ``SemiMonthEnd`` ('SM') and ``SemiMonthBegin`` ('SMS'). @@ -596,7 +596,7 @@ Comparison operators Comparison operators raise ``ValueError`` when ``.index`` are different. -**Previous Behavior** (``Series``): +**Previous behavior** (``Series``): ``Series`` compared values ignoring the ``.index`` as long as both had the same length: @@ -631,7 +631,7 @@ Comparison operators raise ``ValueError`` when ``.index`` are different. s1.eq(s2) -**Current Behavior** (``DataFrame``, no change): +**Current behavior** (``DataFrame``, no change): .. code-block:: ipython @@ -675,7 +675,7 @@ Logical operators align both ``.index`` of left and right hand side. s1 & s2.reindex_like(s1) -**Current Behavior** (``DataFrame``, no change): +**Current behavior** (``DataFrame``, no change): .. ipython:: python @@ -1324,7 +1324,7 @@ operations on that platform. .. _whatsnew_0190.api.other: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - ``Timestamp.to_pydatetime`` will issue a ``UserWarning`` when ``warn=True``, and the instance has a non-zero number of nanoseconds, previously this would print a message to stdout (:issue:`14101`). @@ -1406,7 +1406,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0190.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of sparse ``IntIndex.intersect`` (:issue:`13082`) @@ -1426,7 +1426,7 @@ Performance Improvements .. _whatsnew_0190.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Bug in ``groupby().shift()``, which could cause a segfault or corruption in rare circumstances when grouping by columns with missing values (:issue:`13813`) diff --git a/doc/source/whatsnew/v0.19.1.rst b/doc/source/whatsnew/v0.19.1.rst index 12f3e985565e0..a89d1461073bd 100644 --- a/doc/source/whatsnew/v0.19.1.rst +++ b/doc/source/whatsnew/v0.19.1.rst @@ -22,7 +22,7 @@ We recommend that all users upgrade to this version. .. _whatsnew_0191.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Fixed performance regression in factorization of ``Period`` data (:issue:`14338`) @@ -34,7 +34,7 @@ Performance Improvements .. _whatsnew_0191.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Source installs from PyPI will now again work without ``cython`` installed, as in previous versions (:issue:`14204`) diff --git a/doc/source/whatsnew/v0.19.2.rst b/doc/source/whatsnew/v0.19.2.rst index 14310ceb45b4a..023bc78081ec9 100644 --- a/doc/source/whatsnew/v0.19.2.rst +++ b/doc/source/whatsnew/v0.19.2.rst @@ -39,7 +39,7 @@ The ``pd.merge_asof()``, added in 0.19.0, gained some improvements: .. _whatsnew_0192.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Performance regression with ``PeriodIndex`` (:issue:`14822`) @@ -50,7 +50,7 @@ Performance Improvements .. _whatsnew_0192.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Compat with python 3.6 for pickling of some offsets (:issue:`14685`) - Compat with python 3.6 for some indexing exception types (:issue:`14684`, :issue:`14689`) diff --git a/doc/source/whatsnew/v0.20.0.rst b/doc/source/whatsnew/v0.20.0.rst index 51c8c488fb9d9..ef6108ae3ec90 100644 --- a/doc/source/whatsnew/v0.20.0.rst +++ b/doc/source/whatsnew/v0.20.0.rst @@ -151,7 +151,7 @@ commonly called 'unix epoch' or POSIX time. This was the previous default, so th .. _whatsnew_0200.enhancements.groupby_access: -Groupby Enhancements +Groupby enhancements ^^^^^^^^^^^^^^^^^^^^ Strings passed to ``DataFrame.groupby()`` as the ``by`` parameter may now reference either column names or index level names. Previously, only column names could be referenced. This allows to easily group by a column and index level at the same time. (:issue:`5677`) @@ -240,7 +240,7 @@ The default is to infer the compression type from the extension (``compression=' .. _whatsnew_0200.enhancements.uint64_support: -UInt64 Support Improved +UInt64 support improved ^^^^^^^^^^^^^^^^^^^^^^^ Pandas has significantly improved support for operations involving unsigned, @@ -263,7 +263,7 @@ Notably, a new numerical index, ``UInt64Index``, has been created (:issue:`14937 .. _whatsnew_0200.enhancements.groupy_categorical: -GroupBy on Categoricals +GroupBy on categoricals ^^^^^^^^^^^^^^^^^^^^^^^ In previous versions, ``.groupby(..., sort=False)`` would fail with a ``ValueError`` when grouping on a categorical series with some categories not appearing in the data. (:issue:`13179`) @@ -280,7 +280,7 @@ In previous versions, ``.groupby(..., sort=False)`` would fail with a ``ValueErr ordered=True)}) df -**Previous Behavior**: +**Previous behavior**: .. code-block:: ipython @@ -288,7 +288,7 @@ In previous versions, ``.groupby(..., sort=False)`` would fail with a ``ValueErr --------------------------------------------------------------------------- ValueError: items in new_categories are not the same as in old categories -**New Behavior**: +**New behavior**: .. ipython:: python @@ -296,7 +296,7 @@ In previous versions, ``.groupby(..., sort=False)`` would fail with a ``ValueErr .. _whatsnew_0200.enhancements.table_schema: -Table Schema Output +Table schema output ^^^^^^^^^^^^^^^^^^^ The new orient ``'table'`` for :meth:`DataFrame.to_json` @@ -457,7 +457,7 @@ Selecting via a scalar value that is contained *in* the intervals. .. _whatsnew_0200.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - ``DataFrame.rolling()`` now accepts the parameter ``closed='right'|'left'|'both'|'neither'`` to choose the rolling window-endpoint closedness. See the :ref:`documentation ` (:issue:`13965`) @@ -580,7 +580,7 @@ Map on Index types now return other Index types mi = pd.MultiIndex.from_tuples([(1, 2), (2, 4)]) mi -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -596,7 +596,7 @@ Previous Behavior: In [8]: mi.map(lambda x: x[0]) Out[8]: array([1, 2]) -New Behavior: +New behavior: .. ipython:: python @@ -616,7 +616,7 @@ New Behavior: .tz_localize('Asia/Tokyo')) s -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -627,7 +627,7 @@ Previous Behavior: 2 2 dtype: int32 -New Behavior: +New behavior: .. ipython:: python @@ -653,7 +653,7 @@ Previous behaviour: In [2]: idx.hour Out[2]: array([ 0, 10, 20, 6, 16], dtype=int32) -New Behavior: +New behavior: .. ipython:: python @@ -697,7 +697,7 @@ data-types would yield different return types. These are now made consistent. (: ...: pd.Timestamp('20160101', tz='US/Eastern')]) Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]') - New Behavior: + New behavior: .. ipython:: python @@ -727,7 +727,7 @@ data-types would yield different return types. These are now made consistent. (: In [2]: pd.unique(pd.Series(list('baabc'), dtype='category')) Out[2]: array(['b', 'a', 'c'], dtype=object) - New Behavior: + New behavior: .. ipython:: python @@ -737,7 +737,7 @@ data-types would yield different return types. These are now made consistent. (: .. _whatsnew_0200.api_breaking.s3: -S3 File Handling +S3 file handling ^^^^^^^^^^^^^^^^ pandas now uses `s3fs `_ for handling S3 connections. This shouldn't break @@ -746,7 +746,7 @@ in prior versions of pandas. (:issue:`11915`). .. _whatsnew_0200.api_breaking.partial_string_indexing: -Partial String Indexing Changes +Partial string indexing changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :ref:`DatetimeIndex Partial String Indexing ` now works as an exact match, provided that string resolution coincides with index resolution, including a case when both are seconds (:issue:`14826`). See :ref:`Slice vs. Exact Match ` for details. @@ -756,7 +756,7 @@ Partial String Indexing Changes df = pd.DataFrame({'a': [1, 2, 3]}, pd.DatetimeIndex(['2011-12-31 23:59:59', '2012-01-01 00:00:00', '2012-01-01 00:00:01'])) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -771,7 +771,7 @@ Previous Behavior: Name: a, dtype: int64 -New Behavior: +New behavior: .. code-block:: ipython @@ -797,7 +797,7 @@ Now the smallest acceptable dtype will be used (:issue:`13247`) df2 = pd.DataFrame(np.array([np.nan], dtype=np.float32, ndmin=2)) df2.dtypes -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -806,7 +806,7 @@ Previous Behavior: 0 float64 dtype: object -New Behavior: +New behavior: .. ipython:: python @@ -823,12 +823,12 @@ currently released version of ``pandas-gbq=0.1.4``. Documentation is now hosted .. _whatsnew_0200.api_breaking.memory_usage: -Memory Usage for Index is more Accurate +Memory usage for Index is more accurate ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In previous versions, showing ``.memory_usage()`` on a pandas structure that has an index, would only include actual index values and not include structures that facilitated fast indexing. This will generally be different for ``Index`` and ``MultiIndex`` and less-so for other index types. (:issue:`15237`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -843,7 +843,7 @@ Previous Behavior: In [11]: index.memory_usage(deep=True) Out[11]: 180 -New Behavior: +New behavior: .. code-block:: ipython @@ -900,7 +900,7 @@ doesn't behave as desired. [[0, 0, 1, 1], [0, 1, 0, 1]])) df -Previous Behavior: +Previous behavior: .. code-block:: python @@ -918,7 +918,7 @@ Previous Behavior: In [15]: df.sort_index().index.is_monotonic Out[15]: False -New Behavior: +New behavior: .. ipython:: python @@ -929,13 +929,13 @@ New Behavior: .. _whatsnew_0200.api_breaking.groupby_describe: -Groupby Describe Formatting +Groupby describe formatting ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The output formatting of ``groupby.describe()`` now labels the ``describe()`` metrics in the columns instead of the index. This format is consistent with ``groupby.agg()`` when applying multiple functions at once. (:issue:`4792`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -970,7 +970,7 @@ Previous Behavior: 1 1.5 0.707107 1 2 2 3.5 0.707107 3 4 -New Behavior: +New behavior: .. ipython:: python @@ -982,7 +982,7 @@ New Behavior: .. _whatsnew_0200.api_breaking.rolling_pairwise: -Window Binary Corr/Cov operations return a MultiIndex DataFrame +Window binary corr/cov operations return a MultiIndex DataFrame ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A binary window operation, like ``.corr()`` or ``.cov()``, when operating on a ``.rolling(..)``, ``.expanding(..)``, or ``.ewm(..)`` object, @@ -1000,7 +1000,7 @@ See the section on :ref:`Windowed Binary Operations ` for periods=100, freq='D', name='foo')) df.tail() -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -1012,7 +1012,7 @@ Previous Behavior: Major_axis axis: A to B Minor_axis axis: A to B -New Behavior: +New behavior: .. ipython:: python @@ -1040,7 +1040,7 @@ usually resulting in an invalid comparison, returning an empty result frame. The df.to_hdf('store.h5', 'key', format='table', data_columns=True) df.dtypes -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -1050,7 +1050,7 @@ Previous Behavior: ^ SyntaxError: invalid token -New Behavior: +New behavior: .. code-block:: ipython @@ -1084,14 +1084,14 @@ joins, :meth:`DataFrame.join` and :func:`merge`, and the ``.align`` method. right = pd.Index([1, 2, 3]) right - Previous Behavior: + Previous behavior: .. code-block:: ipython In [4]: left.intersection(right) Out[4]: Int64Index([1, 2], dtype='int64') - New Behavior: + New behavior: .. ipython:: python @@ -1106,7 +1106,7 @@ joins, :meth:`DataFrame.join` and :func:`merge`, and the ``.align`` method. right = pd.DataFrame({'b': [100, 200, 300]}, index=[1, 2, 3]) right - Previous Behavior: + Previous behavior: .. code-block:: ipython @@ -1116,7 +1116,7 @@ joins, :meth:`DataFrame.join` and :func:`merge`, and the ``.align`` method. 1 10 100 2 20 200 - New Behavior: + New behavior: .. ipython:: python @@ -1124,7 +1124,7 @@ joins, :meth:`DataFrame.join` and :func:`merge`, and the ``.align`` method. .. _whatsnew_0200.api_breaking.pivot_table: -Pivot Table always returns a DataFrame +Pivot table always returns a DataFrame ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The documentation for :meth:`pivot_table` states that a ``DataFrame`` is *always* returned. Here a bug @@ -1137,7 +1137,7 @@ is fixed that allowed this to return a ``Series`` under certain circumstance. (: 'col3': [1, 3, 9]}) df -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -1149,7 +1149,7 @@ Previous Behavior: 9 E 5 Name: col1, dtype: int64 -New Behavior: +New behavior: .. ipython:: python @@ -1157,7 +1157,7 @@ New Behavior: .. _whatsnew_0200.api: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - ``numexpr`` version is now required to be >= 2.4.6 and it will not be used at all if this requisite is not fulfilled (:issue:`15213`). @@ -1192,12 +1192,12 @@ Other API Changes .. _whatsnew_0200.privacy: -Reorganization of the library: Privacy Changes +Reorganization of the library: privacy changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. _whatsnew_0200.privacy.extensions: -Modules Privacy Has Changed +Modules privacy has changed ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some formerly public python/c/c++/cython extension modules have been moved and/or renamed. These are all removed from the public API. @@ -1327,7 +1327,7 @@ Using ``.ix`` will now show a ``DeprecationWarning`` with a link to some example df -Previous Behavior, where you wish to get the 0th and the 2nd elements from the index in the 'A' column. +Previous behavior, where you wish to get the 0th and the 2nd elements from the index in the 'A' column. .. code-block:: ipython @@ -1532,7 +1532,7 @@ Should be changed to: .. _whatsnew_0200.deprecations.other: -Other Deprecations +Other deprecations ^^^^^^^^^^^^^^^^^^ - ``SparseArray.to_dense()`` has deprecated the ``fill`` parameter, as that parameter was not being respected (:issue:`14647`) @@ -1584,7 +1584,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0200.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of ``pd.wide_to_long()`` (:issue:`14779`) @@ -1606,7 +1606,7 @@ Performance Improvements .. _whatsnew_0200.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ Conversion @@ -1713,7 +1713,7 @@ Plotting - Bug in the date and time converters pandas registers with matplotlib not handling multiple dimensions (:issue:`16026`) - Bug in ``pd.scatter_matrix()`` could accept either ``color`` or ``c``, but not both (:issue:`14855`) -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in ``.groupby(..).resample()`` when passed the ``on=`` kwarg. (:issue:`15021`) diff --git a/doc/source/whatsnew/v0.20.2.rst b/doc/source/whatsnew/v0.20.2.rst index b2592579eb03f..232d1d283d9bd 100644 --- a/doc/source/whatsnew/v0.20.2.rst +++ b/doc/source/whatsnew/v0.20.2.rst @@ -35,7 +35,7 @@ Enhancements .. _whatsnew_0202.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Performance regression fix when indexing with a list-like (:issue:`16285`) @@ -46,7 +46,7 @@ Performance Improvements .. _whatsnew_0202.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Silenced a warning on some Windows environments about "tput: terminal attributes: No such device or address" when @@ -97,7 +97,7 @@ Plotting -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in creating a time-based rolling window on an empty ``DataFrame`` (:issue:`15819`) diff --git a/doc/source/whatsnew/v0.20.3.rst b/doc/source/whatsnew/v0.20.3.rst index 8dc6acc2074bd..72faabd95bf1f 100644 --- a/doc/source/whatsnew/v0.20.3.rst +++ b/doc/source/whatsnew/v0.20.3.rst @@ -20,7 +20,7 @@ and bug fixes. We recommend that all users upgrade to this version. .. _whatsnew_0203.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ - Fixed a bug in failing to compute rolling computations of a column-MultiIndexed ``DataFrame`` (:issue:`16789`, :issue:`16825`) diff --git a/doc/source/whatsnew/v0.21.0.rst b/doc/source/whatsnew/v0.21.0.rst index 44b50437a6dfe..34b610e8af0b3 100644 --- a/doc/source/whatsnew/v0.21.0.rst +++ b/doc/source/whatsnew/v0.21.0.rst @@ -300,7 +300,7 @@ as in :meth:`DataFrame.rename`. .. _whatsnew_0210.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ New functions or methods @@ -412,7 +412,7 @@ Previously WITH ``bottleneck``: In [2]: s.sum() Out[2]: 0.0 -New Behavior, without regard to the bottleneck installation: +New behavior, without regard to the bottleneck installation: .. ipython:: python @@ -434,7 +434,7 @@ but for consistency with the all-NaN case, this was changed to return NaN as wel .. _whatsnew_0210.api_breaking.loc: -Indexing with a list with missing labels is Deprecated +Indexing with a list with missing labels is deprecated ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Previously, selecting with a list of labels, where one or more labels were missing would always succeed, returning ``NaN`` for missing labels. @@ -448,7 +448,7 @@ See the :ref:`deprecation docs `. s = pd.Series([1, 2, 3]) s -Previous Behavior +Previous behavior .. code-block:: ipython @@ -460,7 +460,7 @@ Previous Behavior dtype: float64 -Current Behavior +Current behavior .. code-block:: ipython @@ -492,7 +492,7 @@ Selection with all keys found is unchanged. .. _whatsnew_0210.api.na_changes: -NA naming Changes +NA naming changes ^^^^^^^^^^^^^^^^^ In order to promote more consistency among the pandas API, we have added additional top-level @@ -524,7 +524,7 @@ Previously: In [2]: type(list(s)[0]) Out[2]: numpy.int64 -New Behaviour: +New behavior: .. ipython:: python @@ -544,7 +544,7 @@ Previously: In [8]: type(df.to_dict()['a'][0]) Out[8]: numpy.int64 -New Behaviour: +New behavior: .. ipython:: python @@ -561,7 +561,7 @@ you would get a label based selection, potentially duplicating result labels, ra (where ``True`` selects elements), this was inconsistent how a boolean numpy array indexed. The new behavior is to act like a boolean numpy array indexer. (:issue:`17738`) -Previous Behavior: +Previous behavior: .. ipython:: python @@ -578,7 +578,7 @@ Previous Behavior: True 2 dtype: int64 -Current Behavior +Current behavior .. ipython:: python @@ -588,7 +588,7 @@ Current Behavior Furthermore, previously if you had an index that was non-numeric (e.g. strings), then a boolean Index would raise a ``KeyError``. This will now be treated as a boolean indexer. -Previously Behavior: +Previously behavior: .. ipython:: python @@ -600,7 +600,7 @@ Previously Behavior: In [39]: s.loc[pd.Index([True, False, True])] KeyError: "None of [Index([True, False, True], dtype='object')] are in the [index]" -Current Behavior +Current behavior .. ipython:: python @@ -614,7 +614,7 @@ Current Behavior In previous versions of pandas, resampling a ``Series``/``DataFrame`` indexed by a ``PeriodIndex`` returned a ``DatetimeIndex`` in some cases (:issue:`12884`). Resampling to a multiplied frequency now returns a ``PeriodIndex`` (:issue:`15944`). As a minor enhancement, resampling a ``PeriodIndex`` can now handle ``NaT`` values (:issue:`13224`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -634,7 +634,7 @@ Previous Behavior: In [5]: resampled.index Out[5]: DatetimeIndex(['2017-03-31', '2017-09-30', '2018-03-31'], dtype='datetime64[ns]', freq='2Q-DEC') -New Behavior: +New behavior: .. ipython:: python @@ -650,7 +650,7 @@ New Behavior: Upsampling and calling ``.ohlc()`` previously returned a ``Series``, basically identical to calling ``.asfreq()``. OHLC upsampling now returns a DataFrame with columns ``open``, ``high``, ``low`` and ``close`` (:issue:`13083`). This is consistent with downsampling and ``DatetimeIndex`` behavior. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -670,7 +670,7 @@ Previous Behavior: open high low close 2000-01 0 9 0 9 -New Behavior: +New behavior: .. ipython:: python @@ -732,7 +732,7 @@ the target. Now, a ``ValueError`` will be raised when such an input is passed in .. _whatsnew_0210.api_breaking.dtype_conversions: -Dtype Conversions +Dtype conversions ^^^^^^^^^^^^^^^^^ Previously assignments, ``.where()`` and ``.fillna()`` with a ``bool`` assignment, would coerce to same the type (e.g. int / float), or raise for datetimelikes. These will now preserve the bools with ``object`` dtypes. (:issue:`16821`). @@ -752,7 +752,7 @@ Previously assignments, ``.where()`` and ``.fillna()`` with a ``bool`` assignmen 2 3 dtype: int64 -New Behavior +New behavior .. ipython:: python @@ -789,7 +789,7 @@ These now coerce to ``object`` dtype. .. _whatsnew_210.api.multiindex_single: -MultiIndex Constructor with a Single Level +MultiIndex constructor with a single level ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The ``MultiIndex`` constructors no longer squeezes a MultiIndex with all @@ -818,7 +818,7 @@ UTC Localization with Series Previously, :func:`to_datetime` did not localize datetime ``Series`` data when ``utc=True`` was passed. Now, :func:`to_datetime` will correctly localize ``Series`` with a ``datetime64[ns, UTC]`` dtype to be consistent with how list-like and ``Index`` data are handled. (:issue:`6415`). -Previous Behavior +Previous behavior .. ipython:: python @@ -833,7 +833,7 @@ Previous Behavior 2 2013-01-01 dtype: datetime64[ns] -New Behavior +New behavior .. ipython:: python @@ -843,14 +843,14 @@ Additionally, DataFrames with datetime columns that were parsed by :func:`read_s .. _whatsnew_0210.api.consistency_of_range_functions: -Consistency of Range Functions +Consistency of range functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In previous versions, there were some inconsistencies between the various range functions: :func:`date_range`, :func:`bdate_range`, :func:`period_range`, :func:`timedelta_range`, and :func:`interval_range`. (:issue:`17471`). 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. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -863,7 +863,7 @@ Previous Behavior: In [3]: pd.period_range(start='2017Q1', end='2017Q4', periods=6, freq='Q') Out[3]: PeriodIndex(['2017Q1', '2017Q2', '2017Q3', '2017Q4', '2018Q1', '2018Q2'], dtype='period[Q-DEC]', freq='Q-DEC') -New Behavior: +New behavior: .. code-block:: ipython @@ -877,7 +877,7 @@ New Behavior: 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``. -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -888,7 +888,7 @@ Previous Behavior: dtype='interval[int64]') -New Behavior: +New behavior: .. ipython:: python @@ -896,7 +896,7 @@ New Behavior: .. _whatsnew_0210.api.mpl_converters: -No Automatic Matplotlib Converters +No automatic Matplotlib converters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pandas no longer registers our ``date``, ``time``, ``datetime``, @@ -915,7 +915,7 @@ converters on first-use (:issue:`17710`). .. _whatsnew_0210.api: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - The Categorical constructor no longer accepts a scalar for the ``categories`` keyword. (:issue:`16022`) @@ -1024,7 +1024,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0210.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of instantiating :class:`SparseDataFrame` (:issue:`16773`) @@ -1036,7 +1036,7 @@ Performance Improvements .. _whatsnew_0210.docs: -Documentation Changes +Documentation changes ~~~~~~~~~~~~~~~~~~~~~ - Several ``NaT`` method docstrings (e.g. :func:`NaT.ctime`) were incorrect (:issue:`17327`) @@ -1044,7 +1044,7 @@ Documentation Changes .. _whatsnew_0210.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ Conversion @@ -1114,7 +1114,7 @@ Plotting - Bug causing ``plotting.parallel_coordinates`` to reset the random seed when using random colors (:issue:`17525`) -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in ``DataFrame.resample(...).size()`` where an empty ``DataFrame`` did not return a ``Series`` (:issue:`14962`) diff --git a/doc/source/whatsnew/v0.21.1.rst b/doc/source/whatsnew/v0.21.1.rst index c8897ca86e8cf..64f3339834b38 100644 --- a/doc/source/whatsnew/v0.21.1.rst +++ b/doc/source/whatsnew/v0.21.1.rst @@ -31,7 +31,7 @@ Highlights include: .. _whatsnew_0211.converters: -Restore Matplotlib datetime Converter Registration +Restore Matplotlib datetime converter registration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Pandas implements some matplotlib converters for nicely formatting the axis @@ -77,7 +77,7 @@ Improvements to the Parquet IO functionality .. _whatsnew_0211.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - :meth:`Timestamp.timestamp` is now available in Python 2.7. (:issue:`17329`) @@ -93,14 +93,14 @@ Deprecations .. _whatsnew_0211.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of plotting large series/dataframes (:issue:`18236`). .. _whatsnew_0211.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ Conversion @@ -143,7 +143,7 @@ Plotting - Bug in ``DataFrame.plot()`` and ``Series.plot()`` with :class:`DatetimeIndex` where a figure generated by them is not pickleable in Python 3 (:issue:`18439`) -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in ``DataFrame.resample(...).apply(...)`` when there is a callable that returns different columns (:issue:`15169`) diff --git a/doc/source/whatsnew/v0.22.0.rst b/doc/source/whatsnew/v0.22.0.rst index b38fcd9d62af4..ea36b35d61740 100644 --- a/doc/source/whatsnew/v0.22.0.rst +++ b/doc/source/whatsnew/v0.22.0.rst @@ -37,7 +37,7 @@ time, we changed the sum and prod of an empty ``Series`` to also be ``NaN``. Based on feedback, we've partially reverted those changes. -Arithmetic Operations +Arithmetic operations ^^^^^^^^^^^^^^^^^^^^^ The default sum for empty or all-*NA* ``Series`` is now ``0``. @@ -93,7 +93,7 @@ returning ``1`` instead. These changes affect :meth:`DataFrame.sum` and :meth:`DataFrame.prod` as well. Finally, a few less obvious places in pandas are affected by this change. -Grouping by a Categorical +Grouping by a categorical ^^^^^^^^^^^^^^^^^^^^^^^^^ Grouping by a ``Categorical`` and summing now returns ``0`` instead of @@ -196,7 +196,7 @@ Once again, the ``min_count`` keyword is available to restore the 0.21 behavior. pd.Series([1, 2], index=idx).resample("12H").sum(min_count=1) -Rolling and Expanding +Rolling and expanding ^^^^^^^^^^^^^^^^^^^^^ Rolling and expanding already have a ``min_periods`` keyword that behaves diff --git a/doc/source/whatsnew/v0.23.0.rst b/doc/source/whatsnew/v0.23.0.rst index 51efa37b55add..41c946cc9a559 100644 --- a/doc/source/whatsnew/v0.23.0.rst +++ b/doc/source/whatsnew/v0.23.0.rst @@ -22,7 +22,7 @@ Highlights include: - :ref:`Instantiation from dicts respects order for Python 3.6+ `. - :ref:`Dependent column arguments for assign `. - :ref:`Merging / sorting on a combination of columns and index levels `. -- :ref:`Extending Pandas with custom types `. +- :ref:`Extending pandas with custom types `. - :ref:`Excluding unobserved categories from groupby `. - :ref:`Changes to make output shape of DataFrame.apply consistent `. @@ -105,7 +105,7 @@ The :func:`DataFrame.assign` now accepts dependent keyword arguments for python using ``.assign()`` to update an existing column. Previously, callables referring to other variables being updated would get the "old" values - Previous Behavior: + Previous behavior: .. code-block:: ipython @@ -118,7 +118,7 @@ The :func:`DataFrame.assign` now accepts dependent keyword arguments for python 1 3 -2 2 4 -3 - New Behavior: + New behavior: .. ipython:: python @@ -186,7 +186,7 @@ resetting indexes. See the :ref:`Sorting by Indexes and Values .. _whatsnew_023.enhancements.extension: -Extending Pandas with Custom Types (Experimental) +Extending pandas with custom types (experimental) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pandas now supports storing array-like objects that aren't necessarily 1-D NumPy @@ -398,7 +398,7 @@ In previous versions, ``.rank()`` would assign ``inf`` elements ``NaN`` as their s = pd.Series([-np.inf, 0, 1, np.nan, np.inf]) s -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -411,7 +411,7 @@ Previous Behavior: 4 NaN dtype: float64 -Current Behavior: +Current behavior: .. ipython:: python @@ -424,7 +424,7 @@ Furthermore, previously if you rank ``inf`` or ``-inf`` values together with ``N s = pd.Series([np.nan, np.nan, -np.inf, -np.inf]) s -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -436,7 +436,7 @@ Previous Behavior: 3 2.5 dtype: float64 -Current Behavior: +Current behavior: .. ipython:: python @@ -502,7 +502,7 @@ Supplying a ``CategoricalDtype`` will make the categories in each column consist .. _whatsnew_0230.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - Unary ``+`` now permitted for ``Series`` and ``DataFrame`` as numeric operator (:issue:`16073`) @@ -597,7 +597,7 @@ Pandas will use the dict's insertion order, when creating a ``Series`` or ``DataFrame`` from a dict and you're using Python version 3.6 or higher. (:issue:`19884`) -Previous Behavior (and current behavior if on Python < 3.6): +Previous behavior (and current behavior if on Python < 3.6): .. code-block:: ipython @@ -614,7 +614,7 @@ Previous Behavior (and current behavior if on Python < 3.6): Note the Series above is ordered alphabetically by the index values. -New Behavior (for Python >= 3.6): +New behavior (for Python >= 3.6): .. ipython:: python @@ -738,7 +738,7 @@ where a list-like (e.g. ``tuple`` or ``list`` is returned) (:issue:`16353`, :iss columns=['A', 'B', 'C']) df -Previous Behavior: if the returned shape happened to match the length of original columns, this would return a ``DataFrame``. +Previous behavior: if the returned shape happened to match the length of original columns, this would return a ``DataFrame``. If the return shape did not match, a ``Series`` with lists was returned. .. code-block:: python @@ -764,7 +764,7 @@ If the return shape did not match, a ``Series`` with lists was returned. dtype: object -New Behavior: When the applied function returns a list-like, this will now *always* return a ``Series``. +New behavior: When the applied function returns a list-like, this will now *always* return a ``Series``. .. ipython:: python @@ -824,7 +824,7 @@ Note that this change also applies to :meth:`DataFrame.append`, which has also r .. _whatsnew_0230.api_breaking.build_changes: -Build Changes +Build changes ^^^^^^^^^^^^^ - Building pandas for development now requires ``cython >= 0.24`` (:issue:`18613`) @@ -833,12 +833,12 @@ Build Changes .. _whatsnew_0230.api_breaking.index_division_by_zero: -Index Division By Zero Fills Correctly +Index division by zero fills correctly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Division operations on ``Index`` and subclasses will now fill division of positive numbers by zero with ``np.inf``, division of negative numbers by zero with ``-np.inf`` and `0 / 0` with ``np.nan``. This matches existing ``Series`` behavior. (:issue:`19322`, :issue:`19347`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -859,7 +859,7 @@ Previous Behavior: In [11]: pd.RangeIndex(1, 5) / 0 ZeroDivisionError: integer division or modulo by zero -Current Behavior: +Current behavior: .. ipython:: python @@ -888,7 +888,7 @@ extracted). As of Pandas 0.23.0 :func:`str.extract` always returns a ``DataFrame ``expand`` is set to ``False``. Finally, ``None`` was an accepted value for the ``expand`` parameter (which was equivalent to ``False``), but now raises a ``ValueError``. (:issue:`11386`) -Previous Behavior: +Previous behavior: .. code-block:: ipython @@ -906,7 +906,7 @@ Previous Behavior: Out [4]: pandas.core.series.Series -New Behavior: +New behavior: .. ipython:: python @@ -933,7 +933,7 @@ The default value of the ``ordered`` parameter for :class:`~pandas.api.types.Cat In previous versions, the default value for the ``ordered`` parameter was ``False``. This could potentially lead to the ``ordered`` parameter unintentionally being changed from ``True`` to ``False`` when users attempt to update ``categories`` if ``ordered`` is not explicitly specified, as it would silently default to ``False``. The new behavior for ``ordered=None`` is to retain the existing value of ``ordered``. -New Behavior: +New behavior: .. ipython:: python @@ -978,7 +978,7 @@ yourself. To revert to the old setting, you can run this line: .. _whatsnew_0230.api.datetimelike: -Datetimelike API Changes +Datetimelike API changes ^^^^^^^^^^^^^^^^^^^^^^^^ - The default ``Timedelta`` constructor now accepts an ``ISO 8601 Duration`` string as an argument (:issue:`19040`) @@ -1007,7 +1007,7 @@ Datetimelike API Changes .. _whatsnew_0230.api.other: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - :func:`Series.astype` and :func:`Index.astype` with an incompatible dtype will now raise a ``TypeError`` rather than a ``ValueError`` (:issue:`18231`) @@ -1130,7 +1130,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0230.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Indexers on ``Series`` or ``DataFrame`` no longer create a reference cycle (:issue:`17956`) @@ -1162,7 +1162,7 @@ Performance Improvements .. _whatsnew_0230.docs: -Documentation Changes +Documentation changes ~~~~~~~~~~~~~~~~~~~~~ Thanks to all of the contributors who participated in the Pandas Documentation @@ -1190,7 +1190,7 @@ read the `NumFOCUS blogpost`_ recapping the sprint. .. _whatsnew_0230.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ Categorical @@ -1393,7 +1393,7 @@ Plotting - :func:`DataFrame.plot` now supports multiple columns to the ``y`` argument (:issue:`19699`) -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug when grouping by a single column and aggregating with a class like ``list`` or ``tuple`` (:issue:`18079`) diff --git a/doc/source/whatsnew/v0.23.1.rst b/doc/source/whatsnew/v0.23.1.rst index 0218c3b02a413..d730a57a01a60 100644 --- a/doc/source/whatsnew/v0.23.1.rst +++ b/doc/source/whatsnew/v0.23.1.rst @@ -1,6 +1,6 @@ .. _whatsnew_0231: -What's New in 0.23.1 (June 12, 2018) +What's new in 0.23.1 (June 12, 2018) ------------------------------------ {{ header }} @@ -20,7 +20,7 @@ and bug fixes. We recommend that all users upgrade to this version. .. _whatsnew_0231.fixed_regressions: -Fixed Regressions +Fixed regressions ~~~~~~~~~~~~~~~~~ **Comparing Series with datetime.date** @@ -64,7 +64,7 @@ To summarize, here's the behavior in 0.22.0, 0.23.0, 0.23.1: In addition, ordering comparisons will raise a ``TypeError`` in the future. -**Other Fixes** +**Other fixes** - Reverted the ability of :func:`~DataFrame.to_sql` to perform multivalue inserts as this caused regression in certain cases (:issue:`21103`). @@ -85,7 +85,7 @@ In addition, ordering comparisons will raise a ``TypeError`` in the future. .. _whatsnew_0231.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Improved performance of :meth:`CategoricalIndex.is_monotonic_increasing`, :meth:`CategoricalIndex.is_monotonic_decreasing` and :meth:`CategoricalIndex.is_monotonic` (:issue:`21025`) @@ -94,10 +94,10 @@ Performance Improvements .. _whatsnew_0231.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ -**Groupby/Resample/Rolling** +**Groupby/resample/rolling** - Bug in :func:`DataFrame.agg` where applying multiple aggregation functions to a :class:`DataFrame` with duplicated column names would cause a stack overflow (:issue:`21063`) - Bug in :func:`pandas.core.groupby.GroupBy.ffill` and :func:`pandas.core.groupby.GroupBy.bfill` where the fill within a grouping would not always be applied as intended due to the implementations' use of a non-stable sort (:issue:`21207`) diff --git a/doc/source/whatsnew/v0.23.2.rst b/doc/source/whatsnew/v0.23.2.rst index cae2415e3374e..df8cc12e3385e 100644 --- a/doc/source/whatsnew/v0.23.2.rst +++ b/doc/source/whatsnew/v0.23.2.rst @@ -1,6 +1,6 @@ .. _whatsnew_0232: -What's New in 0.23.2 (July 5, 2018) +What's new in 0.23.2 (July 5, 2018) ----------------------------------- {{ header }} @@ -25,7 +25,7 @@ and bug fixes. We recommend that all users upgrade to this version. .. _whatsnew_0232.enhancements: -Logical Reductions over Entire DataFrame +Logical reductions over entire DataFrame ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :meth:`DataFrame.all` and :meth:`DataFrame.any` now accept ``axis=None`` to reduce over all axes to a scalar (:issue:`19976`) @@ -56,7 +56,7 @@ With pandas 0.23.2, that will correctly return False, as it did with NumPy < 1.1 .. _whatsnew_0232.fixed_regressions: -Fixed Regressions +Fixed regressions ~~~~~~~~~~~~~~~~~ - Fixed regression in :meth:`to_csv` when handling file-like object incorrectly (:issue:`21471`) @@ -70,14 +70,14 @@ Fixed Regressions - Fixed regression in :func:`to_clipboard` that defaulted to copying dataframes with space delimited instead of tab delimited (:issue:`21104`) -Build Changes +Build changes ~~~~~~~~~~~~~ - The source and binary distributions no longer include test data files, resulting in smaller download sizes. Tests relying on these data files will be skipped when using ``pandas.test()``. (:issue:`19320`) .. _whatsnew_0232.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ **Conversion** diff --git a/doc/source/whatsnew/v0.23.3.rst b/doc/source/whatsnew/v0.23.3.rst index 3b1a0cfa5f273..bb8862a89b003 100644 --- a/doc/source/whatsnew/v0.23.3.rst +++ b/doc/source/whatsnew/v0.23.3.rst @@ -1,6 +1,6 @@ .. _whatsnew_0233: -What's New in 0.23.3 (July 7, 2018) +What's new in 0.23.3 (July 7, 2018) ----------------------------------- {{ header }} diff --git a/doc/source/whatsnew/v0.23.4.rst b/doc/source/whatsnew/v0.23.4.rst index 01f904e129f80..060d1fc8eba34 100644 --- a/doc/source/whatsnew/v0.23.4.rst +++ b/doc/source/whatsnew/v0.23.4.rst @@ -1,6 +1,6 @@ .. _whatsnew_0234: -What's New in 0.23.4 (August 3, 2018) +What's new in 0.23.4 (August 3, 2018) ------------------------------------- {{ header }} @@ -20,17 +20,17 @@ and bug fixes. We recommend that all users upgrade to this version. .. _whatsnew_0234.fixed_regressions: -Fixed Regressions +Fixed regressions ~~~~~~~~~~~~~~~~~ - Python 3.7 with Windows gave all missing values for rolling variance calculations (:issue:`21813`) .. _whatsnew_0234.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ -**Groupby/Resample/Rolling** +**Groupby/resample/rolling** - Bug where calling :func:`DataFrameGroupBy.agg` with a list of functions including ``ohlc`` as the non-initial element would raise a ``ValueError`` (:issue:`21716`) - Bug in ``roll_quantile`` caused a memory leak when calling ``.rolling(...).quantile(q)`` with ``q`` in (0,1) (:issue:`21965`) diff --git a/doc/source/whatsnew/v0.24.0.rst b/doc/source/whatsnew/v0.24.0.rst index 086519ad75192..403b4908d36e3 100644 --- a/doc/source/whatsnew/v0.24.0.rst +++ b/doc/source/whatsnew/v0.24.0.rst @@ -1,6 +1,6 @@ .. _whatsnew_0240: -What's New in 0.24.0 (January 25, 2019) +What's new in 0.24.0 (January 25, 2019) --------------------------------------- .. warning:: @@ -35,7 +35,7 @@ Enhancements .. _whatsnew_0240.enhancements.intna: -Optional Integer NA Support +Optional integer NA support ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pandas has gained the ability to hold integer dtypes with missing values. This long requested feature is enabled through the use of :ref:`extension types `. @@ -194,7 +194,7 @@ is a float. .. _whatsnew_0240.enhancements.interval: -Storing Interval and Period Data in Series and DataFrame +Storing Interval and Period data in Series and DataFrame ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :class:`Interval` and :class:`Period` data may now be stored in a :class:`Series` or :class:`DataFrame`, in addition to an @@ -300,7 +300,7 @@ value. (:issue:`17054`) """) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -309,7 +309,7 @@ value. (:issue:`17054`) [ A B C 0 1 2 NaN] -*New Behavior*: +*New behavior*: .. ipython:: python @@ -361,7 +361,7 @@ See the :ref:`Advanced documentation on renaming` for more .. _whatsnew_0240.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - :func:`merge` now directly allows merge between objects of type ``DataFrame`` and named ``Series``, without the need to convert the ``Series`` object into a ``DataFrame`` beforehand (:issue:`21220`) @@ -482,7 +482,7 @@ for the default line terminator (:issue:`20353`). This change only affects when running on Windows, where ``'\r\n'`` was used for line terminator even when ``'\n'`` was passed in ``line_terminator``. -*Previous Behavior* on Windows: +*Previous behavior* on Windows: .. code-block:: ipython @@ -508,7 +508,7 @@ even when ``'\n'`` was passed in ``line_terminator``. Out[5]: b'string_with_lf,string_with_crlf\n"a\nbc","a\r\nbc"\n' -*New Behavior* on Windows: +*New behavior* on Windows: Passing ``line_terminator`` explicitly, set thes ``line terminator`` to that character. @@ -569,7 +569,7 @@ missing indicator, ``np.nan``. (:issue:`20377`) from io import StringIO -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -579,7 +579,7 @@ missing indicator, ``np.nan``. (:issue:`20377`) Out[7]: 'nan' -*New Behavior*: +*New behavior*: .. ipython:: python @@ -591,7 +591,7 @@ Notice how we now instead output ``np.nan`` itself instead of a stringified form .. _whatsnew_0240.api.timezone_offset_parsing: -Parsing Datetime Strings with Timezone Offsets +Parsing datetime strings with timezone offsets ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Previously, parsing datetime strings with UTC offsets with :func:`to_datetime` @@ -602,7 +602,7 @@ offset in the ``tz`` attribute. Now, :func:`to_datetime` preserves the UTC offset in the ``tz`` attribute when all the datetime strings have the same UTC offset (:issue:`17697`, :issue:`11736`, :issue:`22457`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -616,7 +616,7 @@ UTC offset (:issue:`17697`, :issue:`11736`, :issue:`22457`) In [4]: pd.to_datetime(["2015-11-18 15:30:00+05:30", "2015-11-18 16:30:00+06:30"]) Out[4]: DatetimeIndex(['2015-11-18 10:00:00', '2015-11-18 10:00:00'], dtype='datetime64[ns]', freq=None) -*New Behavior*: +*New behavior*: .. ipython:: python @@ -656,7 +656,7 @@ Parsing mixed-timezones with :func:`read_csv` :func:`read_csv` no longer silently converts mixed-timezone columns to UTC (:issue:`24987`). -*Previous Behavior* +*Previous behavior* .. code-block:: python @@ -671,7 +671,7 @@ Parsing mixed-timezones with :func:`read_csv` 1 1999-12-31 18:00:00 Name: a, dtype: datetime64[ns] -*New Behavior* +*New behavior* .. ipython:: python @@ -704,7 +704,7 @@ to '23:59:59.999999999' when calling :attr:`Series.dt.end_time`, :attr:`Period.e :attr:`PeriodIndex.end_time`, :func:`Period.to_timestamp()` with ``how='end'``, or :func:`PeriodIndex.to_timestamp()` with ``how='end'`` (:issue:`17157`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -717,7 +717,7 @@ or :func:`PeriodIndex.to_timestamp()` with ``how='end'`` (:issue:`17157`) In [5]: p.end_time Out[5]: Timestamp(2017-01-01 23:59:59.999999999) -*New Behavior*: +*New behavior*: Calling :attr:`Series.dt.end_time` will now result in a time of '23:59:59.999999999' as is the case with :attr:`Period.end_time`, for example @@ -744,7 +744,7 @@ from an :class:`numpy.ndarray` of :class:`Timestamp` objects to a :class:`arrays ser = pd.Series([pd.Timestamp('2000', tz='UTC'), pd.Timestamp('2000', tz='UTC')]) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -752,7 +752,7 @@ from an :class:`numpy.ndarray` of :class:`Timestamp` objects to a :class:`arrays Out[3]: array([Timestamp('2000-01-01 00:00:00+0000', tz='UTC')], dtype=object) -*New Behavior*: +*New behavior*: .. ipython:: python @@ -761,7 +761,7 @@ from an :class:`numpy.ndarray` of :class:`Timestamp` objects to a :class:`arrays .. _whatsnew_0240.api_breaking.sparse_values: -Sparse Data Structure Refactor +Sparse data structure refactor ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``SparseArray``, the array backing ``SparseSeries`` and the columns in a ``SparseDataFrame``, @@ -807,7 +807,7 @@ Previously, when ``sparse=True`` was passed to :func:`get_dummies`, the return v a :class:`DataFrame` or a :class:`SparseDataFrame`, depending on whether all or a just a subset of the columns were dummy-encoded. Now, a :class:`DataFrame` is always returned (:issue:`24284`). -*Previous Behavior* +*Previous behavior* The first :func:`get_dummies` returns a :class:`DataFrame` because the column ``A`` is not dummy encoded. When just ``["B", "C"]`` are passed to ``get_dummies``, @@ -828,7 +828,7 @@ then all the columns are dummy-encoded, and a :class:`SparseDataFrame` was retur df = pd.DataFrame({"A": [1, 2], "B": ['a', 'b'], "C": ['a', 'a']}) -*New Behavior* +*New behavior* Now, the return type is consistently a :class:`DataFrame`. @@ -861,7 +861,7 @@ Bug in :func:`DataFrame.to_dict` raises ``ValueError`` when used with .. _whatsnew_0240.api.datetimelike.normalize: -Tick DateOffset Normalize Restrictions +Tick DateOffset normalize restrictions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Creating a ``Tick`` object (:class:`Day`, :class:`Hour`, :class:`Minute`, @@ -869,7 +869,7 @@ Creating a ``Tick`` object (:class:`Day`, :class:`Hour`, :class:`Minute`, ``normalize=True`` is no longer supported. This prevents unexpected behavior where addition could fail to be monotone or associative. (:issue:`21427`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -891,7 +891,7 @@ where addition could fail to be monotone or associative. (:issue:`21427`) In [7]: ts + tic + tic + tic == ts + (tic + tic + tic) Out[7]: False -*New Behavior*: +*New behavior*: .. ipython:: python @@ -905,13 +905,13 @@ where addition could fail to be monotone or associative. (:issue:`21427`) .. _whatsnew_0240.api.period_subtraction: -Period Subtraction +Period subtraction ^^^^^^^^^^^^^^^^^^ Subtraction of a ``Period`` from another ``Period`` will give a ``DateOffset``. instead of an integer (:issue:`21314`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -922,7 +922,7 @@ instead of an integer (:issue:`21314`) In [4]: june - april Out [4]: 2 -*New Behavior*: +*New behavior*: .. ipython:: python @@ -933,7 +933,7 @@ instead of an integer (:issue:`21314`) Similarly, subtraction of a ``Period`` from a ``PeriodIndex`` will now return an ``Index`` of ``DateOffset`` objects instead of an ``Int64Index`` -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -942,7 +942,7 @@ an ``Index`` of ``DateOffset`` objects instead of an ``Int64Index`` In [3]: pi - pi[0] Out[3]: Int64Index([0, 1, 2], dtype='int64') -*New Behavior*: +*New behavior*: .. ipython:: python @@ -952,7 +952,7 @@ an ``Index`` of ``DateOffset`` objects instead of an ``Int64Index`` .. _whatsnew_0240.api.timedelta64_subtract_nan: -Addition/Subtraction of ``NaN`` from :class:`DataFrame` +Addition/subtraction of ``NaN`` from :class:`DataFrame` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Adding or subtracting ``NaN`` from a :class:`DataFrame` column with @@ -965,7 +965,7 @@ all-``NaT``. This is for compatibility with ``TimedeltaIndex`` and df = pd.DataFrame([pd.Timedelta(days=1)]) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -976,7 +976,7 @@ all-``NaT``. This is for compatibility with ``TimedeltaIndex`` and 0 0 NaT -*New Behavior*: +*New behavior*: .. code-block:: ipython @@ -986,7 +986,7 @@ all-``NaT``. This is for compatibility with ``TimedeltaIndex`` and .. _whatsnew_0240.api.dataframe_cmp_broadcasting: -DataFrame Comparison Operations Broadcasting Changes +DataFrame comparison operations broadcasting changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Previously, the broadcasting behavior of :class:`DataFrame` comparison operations (``==``, ``!=``, ...) was inconsistent with the behavior of @@ -1006,7 +1006,7 @@ The affected cases are: df = pd.DataFrame(arr) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -1045,7 +1045,7 @@ The affected cases are: ... ValueError: Unable to coerce to Series, length must be 2: given 3 -*New Behavior*: +*New behavior*: .. ipython:: python @@ -1072,7 +1072,7 @@ The affected cases are: .. _whatsnew_0240.api.dataframe_arithmetic_broadcasting: -DataFrame Arithmetic Operations Broadcasting Changes +DataFrame arithmetic operations broadcasting changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :class:`DataFrame` arithmetic operations when operating with 2-dimensional @@ -1085,7 +1085,7 @@ broadcast. (:issue:`23000`) df = pd.DataFrame(arr) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -1096,7 +1096,7 @@ broadcast. (:issue:`23000`) ... ValueError: Unable to coerce to DataFrame, shape must be (3, 2): given (3, 1) -*New Behavior*: +*New behavior*: .. ipython:: python @@ -1105,13 +1105,13 @@ broadcast. (:issue:`23000`) .. _whatsnew_0240.api.incompatibilities: -Series and Index Data-Dtype Incompatibilities +Series and Index data-dtype incompatibilities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``Series`` and ``Index`` constructors now raise when the data is incompatible with a passed ``dtype=`` (:issue:`15832`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -1120,7 +1120,7 @@ data is incompatible with a passed ``dtype=`` (:issue:`15832`) 0 18446744073709551615 dtype: uint64 -*New Behavior*: +*New behavior*: .. code-block:: ipython @@ -1143,7 +1143,7 @@ other than another ``Categorical`` of ints (:issue:`19214`) s = pd.Series([0, 1, np.nan]) c = pd.Series([0, 1, np.nan], dtype="category") -*Previous Behavior* +*Previous behavior* .. code-block:: ipython @@ -1157,13 +1157,13 @@ other than another ``Categorical`` of ints (:issue:`19214`) 2 NaN dtype: float64 -*New Behavior* +*New behavior* .. ipython:: python pd.concat([s, c]) -Datetimelike API Changes +Datetimelike API changes ^^^^^^^^^^^^^^^^^^^^^^^^ - For :class:`DatetimeIndex` and :class:`TimedeltaIndex` with non-``None`` ``freq`` attribute, addition or subtraction of integer-dtyped array or ``Index`` will return an object of the same class (:issue:`19959`) @@ -1175,7 +1175,7 @@ Datetimelike API Changes .. _whatsnew_0240.api.other: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - A newly constructed empty :class:`DataFrame` with integer as the ``dtype`` will now only be cast to ``float64`` if ``index`` is specified (:issue:`22858`) @@ -1212,10 +1212,10 @@ Other API Changes .. _whatsnew_0240.api.extension: -Extension Type Changes +Extension type changes ~~~~~~~~~~~~~~~~~~~~~~ -**Equality and Hashability** +**Equality and hashability** Pandas now requires that extension dtypes be hashable (i.e. the respective ``ExtensionDtype`` objects; hashability is not a requirement for the values @@ -1263,7 +1263,7 @@ ways of adding operator support. - :meth:`ExtensionArray._formatting_values` is deprecated. Use :attr:`ExtensionArray._formatter` instead. (:issue:`23601`) - An ``ExtensionArray`` with a boolean dtype now works correctly as a boolean indexer. :meth:`pandas.api.types.is_bool_dtype` now properly considers them boolean (:issue:`22326`) -**Bug Fixes** +**Bug fixes** - Bug in :meth:`Series.get` for ``Series`` using ``ExtensionArray`` and integer index (:issue:`21257`) - :meth:`~Series.shift` now dispatches to :meth:`ExtensionArray.shift` (:issue:`22386`) @@ -1329,7 +1329,7 @@ Deprecations .. _whatsnew_0240.deprecations.datetimelike_int_ops: -Integer Addition/Subtraction with Datetimes and Timedeltas is Deprecated +Integer addition/subtraction with datetimes and timedeltas is deprecated ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In the past, users could—in some cases—add or subtract integers or integer-dtype @@ -1338,7 +1338,7 @@ arrays from :class:`Timestamp`, :class:`DatetimeIndex` and :class:`TimedeltaInde This usage is now deprecated. Instead add or subtract integer multiples of the object's ``freq`` attribute (:issue:`21939`, :issue:`23878`). -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -1354,7 +1354,7 @@ the object's ``freq`` attribute (:issue:`21939`, :issue:`23878`). In [10]: dti + pd.Index([1, 2]) Out[10]: DatetimeIndex(['2001-01-08', '2001-01-22'], dtype='datetime64[ns]', freq=None) -*New Behavior*: +*New behavior*: .. ipython:: python :okwarning: @@ -1371,7 +1371,7 @@ the object's ``freq`` attribute (:issue:`21939`, :issue:`23878`). .. _whatsnew_0240.deprecations.integer_tz: -Passing Integer data and a timezone to DatetimeIndex +Passing integer data and a timezone to datetimeindex ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The behavior of :class:`DatetimeIndex` when passed integer data and @@ -1417,7 +1417,7 @@ The old behavior can be retained with by localizing directly to the final timezo .. _whatsnew_0240.deprecations.tz_aware_array: -Converting Timezone-Aware Series and Index to NumPy Arrays +Converting timezone-aware Series and Index to NumPy arrays ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The conversion from a :class:`Series` or :class:`Index` with timezone-aware @@ -1459,13 +1459,13 @@ The default behavior remains the same, but issues a warning The previous or future behavior can be obtained, without any warnings, by specifying the ``dtype`` -*Previous Behavior* +*Previous behavior* .. ipython:: python np.asarray(ser, dtype='datetime64[ns]') -*Future Behavior* +*Future behavior* .. ipython:: python @@ -1512,7 +1512,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0240.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Slicing Series and DataFrames with an monotonically increasing :class:`CategoricalIndex` @@ -1547,7 +1547,7 @@ Performance Improvements .. _whatsnew_0240.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ Categorical @@ -1827,7 +1827,7 @@ Plotting - Bug in :func:`DataFrame.plot.bar` caused bars to use multiple colors instead of a single one (:issue:`20585`) - Bug in validating color parameter caused extra color to be appended to the given color array. This happened to multiple plotting functions using matplotlib. (:issue:`20726`) -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in :func:`pandas.core.window.Rolling.min` and :func:`pandas.core.window.Rolling.max` with ``closed='left'``, a datetime-like index and only one entry in the series leading to segfault (:issue:`24718`) @@ -1915,7 +1915,7 @@ Style - :meth:`~pandas.io.formats.style.Styler.background_gradient` now also supports tablewise application (in addition to rowwise and columnwise) with ``axis=None`` (:issue:`15204`) - :meth:`~pandas.io.formats.style.Styler.bar` now also supports tablewise application (in addition to rowwise and columnwise) with ``axis=None`` and setting clipping range with ``vmin`` and ``vmax`` (:issue:`21548` and :issue:`21526`). ``NaN`` values are also handled properly. -Build Changes +Build changes ^^^^^^^^^^^^^ - Building pandas for development now requires ``cython >= 0.28.2`` (:issue:`21688`) diff --git a/doc/source/whatsnew/v0.24.1.rst b/doc/source/whatsnew/v0.24.1.rst index 8f963f1285e1b..9dffe1f076477 100644 --- a/doc/source/whatsnew/v0.24.1.rst +++ b/doc/source/whatsnew/v0.24.1.rst @@ -2,7 +2,7 @@ .. _whatsnew_0241: -Whats New in 0.24.1 (February 3, 2019) +Whats new in 0.24.1 (February 3, 2019) -------------------------------------- .. warning:: @@ -17,7 +17,7 @@ including other versions of pandas. See :ref:`whatsnew_0240` for the 0.24.0 chan .. _whatsnew_0241.api: -API Changes +API changes ~~~~~~~~~~~ Changing the ``sort`` parameter for :class:`Index` set operations @@ -47,7 +47,7 @@ The `sort` option for :meth:`Index.intersection` has changed in three ways. .. _whatsnew_0241.regressions: -Fixed Regressions +Fixed regressions ~~~~~~~~~~~~~~~~~ - Fixed regression in :meth:`DataFrame.to_dict` with ``records`` orient raising an @@ -62,7 +62,7 @@ Fixed Regressions .. _whatsnew_0241.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ **Reshaping** diff --git a/doc/source/whatsnew/v0.24.2.rst b/doc/source/whatsnew/v0.24.2.rst index c3b442e2352bb..21936ba270c77 100644 --- a/doc/source/whatsnew/v0.24.2.rst +++ b/doc/source/whatsnew/v0.24.2.rst @@ -2,7 +2,7 @@ .. _whatsnew_0242: -Whats New in 0.24.2 (March 12, 2019) +Whats new in 0.24.2 (March 12, 2019) ------------------------------------ .. warning:: @@ -17,7 +17,7 @@ including other versions of pandas. .. _whatsnew_0242.regressions: -Fixed Regressions +Fixed regressions ~~~~~~~~~~~~~~~~~ - Fixed regression in :meth:`DataFrame.all` and :meth:`DataFrame.any` where ``bool_only=True`` was ignored (:issue:`25101`) @@ -39,7 +39,7 @@ Fixed Regressions .. _whatsnew_0242.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ **I/O** diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index 2487acfe5579a..a43901ac05016 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -1,6 +1,6 @@ .. _whatsnew_0250: -What's New in 0.25.0 (April XX, 2019) +What's new in 0.25.0 (April XX, 2019) ------------------------------------- .. warning:: @@ -24,7 +24,7 @@ Enhancements .. _whatsnew_0250.enhancements.agg_relabel: -Groupby Aggregation with Relabeling +Groupby aggregation with relabeling ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pandas has added special groupby behavior, known as "named aggregation", for naming the @@ -108,7 +108,7 @@ the output will truncate, if it's wider than :attr:`options.display.width` .. _whatsnew_0250.enhancements.other: -Other Enhancements +Other enhancements ^^^^^^^^^^^^^^^^^^ - :func:`DataFrame.plot` keywords ``logy``, ``logx`` and ``loglog`` can now accept the value ``'sym'`` for symlog scaling. (:issue:`24867`) - Added support for ISO week year format ('%G-%V-%u') when parsing datetimes using :meth:`to_datetime` (:issue:`16607`) @@ -154,7 +154,7 @@ is respected in indexing. (:issue:`24076`, :issue:`16785`) df = pd.DataFrame([0], index=pd.DatetimeIndex(['2019-01-01'], tz='US/Pacific')) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -163,7 +163,7 @@ is respected in indexing. (:issue:`24076`, :issue:`16785`) 0 2019-01-01 00:00:00-08:00 0 -*New Behavior*: +*New behavior*: .. ipython:: python @@ -180,7 +180,7 @@ Constructing a :class:`MultiIndex` with ``NaN`` levels or codes value < -1 was a Now, construction with codes value < -1 is not allowed and ``NaN`` levels' corresponding codes would be reassigned as -1. (:issue:`19387`) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython @@ -194,7 +194,7 @@ would be reassigned as -1. (:issue:`19387`) Out[2]: MultiIndex(levels=[[1, 2]], codes=[[0, -2]]) -*New Behavior*: +*New behavior*: .. ipython:: python :okexcept: @@ -206,7 +206,7 @@ would be reassigned as -1. (:issue:`19387`) .. _whatsnew_0250.api_breaking.groupby_apply_first_group_once: -``GroupBy.apply`` on ``DataFrame`` evaluates first group only once +``Groupby.apply`` on ``DataFrame`` evaluates first group only once ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The implementation of :meth:`DataFrameGroupBy.apply() ` @@ -225,7 +225,7 @@ Now every group is evaluated only a single time. print(group.name) return group -*Previous Behavior*: +*Previous behavior*: .. code-block:: python @@ -238,14 +238,14 @@ Now every group is evaluated only a single time. 0 x 1 1 y 2 -*New Behavior*: +*New behavior*: .. ipython:: python df.groupby("a").apply(func) -Concatenating Sparse Values +Concatenating sparse values ^^^^^^^^^^^^^^^^^^^^^^^^^^^ When passed DataFrames whose values are sparse, :func:`concat` will now return a @@ -255,14 +255,14 @@ When passed DataFrames whose values are sparse, :func:`concat` will now return a df = pd.DataFrame({"A": pd.SparseArray([0, 1])}) -*Previous Behavior*: +*Previous behavior*: .. code-block:: ipython In [2]: type(pd.concat([df, df])) pandas.core.sparse.frame.SparseDataFrame -*New Behavior*: +*New behavior*: .. ipython:: python @@ -288,7 +288,7 @@ of ``object`` dtype. :attr:`Series.str` will now infer the dtype data *within* t ``'bytes'``-only data will raise an exception (except for :meth:`Series.str.decode`, :meth:`Series.str.get`, :meth:`Series.str.len`, :meth:`Series.str.slice`), see :issue:`23163`, :issue:`23011`, :issue:`23551`. -*Previous Behavior*: +*Previous behavior*: .. code-block:: python @@ -308,7 +308,7 @@ of ``object`` dtype. :attr:`Series.str` will now infer the dtype data *within* t 2 False dtype: bool -*New Behavior*: +*New behavior*: .. ipython:: python :okexcept: @@ -319,7 +319,7 @@ of ``object`` dtype. :attr:`Series.str` will now infer the dtype data *within* t .. _whatsnew_0250.api_breaking.incompatible_index_unions: -Incompatible Index Type Unions +Incompatible Index type unions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When performing :func:`Index.union` operations between objects of incompatible dtypes, @@ -329,7 +329,7 @@ of empty :class:`Index` objects will now be evaluated before performing union op rather than simply returning the other :class:`Index` object. :func:`Index.union` can now be considered commutative, such that ``A.union(B) == B.union(A)`` (:issue:`23525`). -*Previous Behavior*: +*Previous behavior*: .. code-block:: python @@ -340,7 +340,7 @@ considered commutative, such that ``A.union(B) == B.union(A)`` (:issue:`23525`). In [2]: pd.Index([], dtype=object).union(pd.Index([1, 2, 3])) Out[2]: Int64Index([1, 2, 3], dtype='int64') -*New Behavior*: +*New behavior*: .. ipython:: python @@ -366,7 +366,7 @@ are returned. (:issue:`21521`) df = pd.DataFrame({"a": ["x", "y"], "b": [1, 2]}) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: python @@ -376,7 +376,7 @@ are returned. (:issue:`21521`) 0 x 1 1 y 2 -*New Behavior*: +*New behavior*: .. ipython:: python @@ -395,7 +395,7 @@ with :attr:`numpy.nan` in the case of an empty :class:`DataFrame` (:issue:`26397 df = pd.DataFrame({"empty_col": pd.Categorical([])}) df -*Previous Behavior*: +*Previous behavior*: .. code-block:: python @@ -405,7 +405,7 @@ with :attr:`numpy.nan` in the case of an empty :class:`DataFrame` (:issue:`26397 count 0 unique 0 -*New Behavior*: +*New behavior*: .. ipython:: python @@ -491,7 +491,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor .. _whatsnew_0250.api.other: -Other API Changes +Other API changes ^^^^^^^^^^^^^^^^^ - :class:`DatetimeTZDtype` will now standardize pytz timezones to a common timezone instance (:issue:`24713`) @@ -510,13 +510,13 @@ Other API Changes Deprecations ~~~~~~~~~~~~ -Sparse Subclasses +Sparse subclasses ^^^^^^^^^^^^^^^^^ The ``SparseSeries`` and ``SparseDataFrame`` subclasses are deprecated. Their functionality is better-provided by a ``Series`` or ``DataFrame`` with sparse values. -**Previous Way** +**Previous way** .. ipython:: python :okwarning: @@ -524,7 +524,7 @@ by a ``Series`` or ``DataFrame`` with sparse values. df = pd.SparseDataFrame({"A": [0, 0, 1, 2]}) df.dtypes -**New Way** +**New way** .. ipython:: python @@ -533,7 +533,7 @@ by a ``Series`` or ``DataFrame`` with sparse values. The memory usage of the two approaches is identical. See :ref:`sparse.migration` for more (:issue:`19239`). -Other Deprecations +Other deprecations ^^^^^^^^^^^^^^^^^^ - The deprecated ``.ix[]`` indexer now raises a more visible ``FutureWarning`` instead of ``DeprecationWarning`` (:issue:`26438`). @@ -547,7 +547,6 @@ Other Deprecations - The :meth:`Series.ftype`, :meth:`Series.ftypes` and :meth:`DataFrame.ftypes` methods are deprecated and will be removed in a future version. Instead, use :meth:`Series.dtype` and :meth:`DataFrame.dtypes` (:issue:`26705`). - :meth:`Timedelta.resolution` is deprecated and replaced with :meth:`Timedelta.resolution_string`. In a future version, :meth:`Timedelta.resolution` will be changed to behave like the standard library :attr:`timedelta.resolution` (:issue:`21344`) -- :meth:`Series.to_sparse`, :meth:`DataFrame.to_sparse`, :meth:`Series.to_dense` and :meth:`DataFrame.to_dense` are deprecated and will be removed in a future version. (:issue:`26557`). .. _whatsnew_0250.prior_deprecations: @@ -563,7 +562,7 @@ Removal of prior version deprecations/changes .. _whatsnew_0250.performance: -Performance Improvements +Performance improvements ~~~~~~~~~~~~~~~~~~~~~~~~ - Significant speedup in :class:`SparseArray` initialization that benefits most operations, fixing performance regression introduced in v0.20.0 (:issue:`24985`) @@ -588,7 +587,7 @@ Performance Improvements .. _whatsnew_0250.bug_fixes: -Bug Fixes +Bug fixes ~~~~~~~~~ @@ -743,7 +742,7 @@ Plotting - - -Groupby/Resample/Rolling +Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ - Bug in :meth:`pandas.core.resample.Resampler.agg` with a timezone aware index where ``OverflowError`` would raise when passing a list of functions (:issue:`22660`) diff --git a/doc/source/whatsnew/v0.4.x.rst b/doc/source/whatsnew/v0.4.x.rst index 0c2047ee69b81..8e41e528f5b75 100644 --- a/doc/source/whatsnew/v0.4.x.rst +++ b/doc/source/whatsnew/v0.4.x.rst @@ -5,7 +5,7 @@ v.0.4.1 through v0.4.3 (September 25 - October 9, 2011) {{ header }} -New Features +New features ~~~~~~~~~~~~ - Added Python 3 support using 2to3 (:issue:`200`) @@ -32,7 +32,7 @@ New Features - :ref:`Enable ` unstacking by name (:issue:`142`) - :ref:`Enable ` ``sortlevel`` to work by level (:issue:`141`) -Performance Enhancements +Performance enhancements ~~~~~~~~~~~~~~~~~~~~~~~~ - Altered binary operations on differently-indexed SparseSeries objects diff --git a/doc/source/whatsnew/v0.5.0.rst b/doc/source/whatsnew/v0.5.0.rst index 4e635a5fe6859..37c52ac7bb34e 100644 --- a/doc/source/whatsnew/v0.5.0.rst +++ b/doc/source/whatsnew/v0.5.0.rst @@ -12,7 +12,7 @@ v.0.5.0 (October 24, 2011) from pandas import * # noqa F401, F403 -New Features +New features ~~~~~~~~~~~~ - :ref:`Added ` ``DataFrame.align`` method with standard join options @@ -36,7 +36,7 @@ New Features - :ref:`Added ` support for different delimiters in ``DataFrame.to_csv`` (:issue:`244`) - TODO: DOCS ABOUT TAKE METHODS -Performance Enhancements +Performance enhancements ~~~~~~~~~~~~~~~~~~~~~~~~ - VBENCH Major performance improvements in file parsing functions ``read_csv`` and ``read_table`` diff --git a/doc/source/whatsnew/v0.6.0.rst b/doc/source/whatsnew/v0.6.0.rst index c0aba18d08b27..973ba897b3234 100644 --- a/doc/source/whatsnew/v0.6.0.rst +++ b/doc/source/whatsnew/v0.6.0.rst @@ -11,7 +11,7 @@ v.0.6.0 (November 25, 2011) from pandas import * # noqa F401, F403 -New Features +New features ~~~~~~~~~~~~ - :ref:`Added ` ``melt`` function to ``pandas.core.reshape`` - :ref:`Added ` ``level`` parameter to group by level in Series and DataFrame descriptive statistics (:issue:`313`) @@ -49,7 +49,7 @@ New Features - :ref:`Added ` ``raw`` option to ``DataFrame.apply`` for performance if only need ndarray (:issue:`309`) - Added proper, tested weighted least squares to standard and panel OLS (:issue:`303`) -Performance Enhancements +Performance enhancements ~~~~~~~~~~~~~~~~~~~~~~~~ - VBENCH Cythonized ``cache_readonly``, resulting in substantial micro-performance enhancements throughout the code base (:issue:`361`) - VBENCH Special Cython matrix iterator for applying arbitrary reduction operations with 3-5x better performance than `np.apply_along_axis` (:issue:`309`) diff --git a/doc/source/whatsnew/v0.7.0.rst b/doc/source/whatsnew/v0.7.0.rst index deff214354e2b..a63cd37e47dc2 100644 --- a/doc/source/whatsnew/v0.7.0.rst +++ b/doc/source/whatsnew/v0.7.0.rst @@ -109,7 +109,7 @@ New features - :ref:`Added ` ``level`` argument to ``xs`` method of DataFrame. -API Changes to integer indexing +API changes to integer indexing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One of the potentially riskiest API changes in 0.7.0, but also one of the most @@ -255,7 +255,7 @@ In the case of integer indexes, the behavior will be exactly as before If you wish to do indexing with sequences and slicing on an integer index with label semantics, use ``ix``. -Other API Changes +Other API changes ~~~~~~~~~~~~~~~~~ - The deprecated ``LongPanel`` class has been completely removed diff --git a/doc/source/whatsnew/v0.7.3.rst b/doc/source/whatsnew/v0.7.3.rst index 24bb756d66d68..a8697f60d7467 100644 --- a/doc/source/whatsnew/v0.7.3.rst +++ b/doc/source/whatsnew/v0.7.3.rst @@ -50,7 +50,7 @@ New features - Add ``kurt`` methods to Series and DataFrame for computing kurtosis -NA Boolean Comparison API Change +NA Boolean comparison API change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reverted some changes to how NA values (represented typically as ``NaN`` or @@ -79,7 +79,7 @@ in numerical arrays, would cause a large amount of problems for users. Thus, a "practicality beats purity" approach was taken. This issue may be revisited at some point in the future. -Other API Changes +Other API changes ~~~~~~~~~~~~~~~~~ When calling ``apply`` on a grouped Series, the return value will also be a