diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 4261d79a5e3f5..41b2b7405fcb5 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -442,7 +442,7 @@ Some other important things to know about the docs: contributing_docstring.rst -* The tutorials make heavy use of the `ipython directive +* The tutorials make heavy use of the `IPython directive `_ sphinx extension. This directive lets you put code in the documentation which will be run during the doc build. For example:: diff --git a/doc/source/development/contributing_docstring.rst b/doc/source/development/contributing_docstring.rst index 26cdd0687706c..623d1e8d45565 100644 --- a/doc/source/development/contributing_docstring.rst +++ b/doc/source/development/contributing_docstring.rst @@ -63,14 +63,14 @@ The first conventions every Python docstring should follow are defined in `PEP-257 `_. As PEP-257 is quite broad, other more specific standards also exist. In the -case of pandas, the numpy docstring convention is followed. These conventions are +case of pandas, the NumPy docstring convention is followed. These conventions are explained in this document: * `numpydoc docstring guide `_ (which is based in the original `Guide to NumPy/SciPy documentation `_) -numpydoc is a Sphinx extension to support the numpy docstring convention. +numpydoc is a Sphinx extension to support the NumPy docstring convention. The standard uses reStructuredText (reST). reStructuredText is a markup language that allows encoding styles in plain text files. Documentation @@ -401,7 +401,7 @@ DataFrame: * pandas.Categorical * pandas.arrays.SparseArray -If the exact type is not relevant, but must be compatible with a numpy +If the exact type is not relevant, but must be compatible with a NumPy array, array-like can be specified. If Any type that can be iterated is accepted, iterable can be used: @@ -819,7 +819,7 @@ positional arguments ``head(3)``. """ A sample DataFrame method. - Do not import numpy and pandas. + Do not import NumPy and pandas. Try to use meaningful data, when it makes the example easier to understand. @@ -854,7 +854,7 @@ Tips for getting your examples pass the doctests Getting the examples pass the doctests in the validation script can sometimes be tricky. Here are some attention points: -* Import all needed libraries (except for pandas and numpy, those are already +* Import all needed libraries (except for pandas and NumPy, those are already imported as ``import pandas as pd`` and ``import numpy as np``) and define all variables you use in the example. diff --git a/doc/source/development/extending.rst b/doc/source/development/extending.rst index 77fe930cf21e3..d4219296f5795 100644 --- a/doc/source/development/extending.rst +++ b/doc/source/development/extending.rst @@ -219,7 +219,7 @@ and re-boxes it if necessary. If applicable, we highly recommend that you implement ``__array_ufunc__`` in your extension array to avoid coercion to an ndarray. See -`the numpy documentation `__ +`the NumPy documentation `__ for an example. As part of your implementation, we require that you defer to pandas when a pandas diff --git a/doc/source/ecosystem.rst b/doc/source/ecosystem.rst index 670905f6587bc..be32c5c14fdfc 100644 --- a/doc/source/ecosystem.rst +++ b/doc/source/ecosystem.rst @@ -174,7 +174,7 @@ invoked with the following command dtale.show(df) -D-Tale integrates seamlessly with jupyter notebooks, python terminals, kaggle +D-Tale integrates seamlessly with Jupyter notebooks, Python terminals, Kaggle & Google Colab. Here are some demos of the `grid `__ and `chart-builder `__. @@ -421,7 +421,7 @@ If also displays progress bars. `Vaex `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Increasingly, packages are being built on top of pandas to address specific needs in data preparation, analysis and visualization. Vaex is a python library for Out-of-Core DataFrames (similar to pandas), to visualize and explore big tabular datasets. It can calculate statistics such as mean, sum, count, standard deviation etc, on an N-dimensional grid up to a billion (10\ :sup:`9`) objects/rows per second. Visualization is done using histograms, density plots and 3d volume rendering, allowing interactive exploration of big data. Vaex uses memory mapping, zero memory copy policy and lazy computations for best performance (no memory wasted). +Increasingly, packages are being built on top of pandas to address specific needs in data preparation, analysis and visualization. Vaex is a Python library for Out-of-Core DataFrames (similar to pandas), to visualize and explore big tabular datasets. It can calculate statistics such as mean, sum, count, standard deviation etc, on an N-dimensional grid up to a billion (10\ :sup:`9`) objects/rows per second. Visualization is done using histograms, density plots and 3d volume rendering, allowing interactive exploration of big data. Vaex uses memory mapping, zero memory copy policy and lazy computations for best performance (no memory wasted). * vaex.from_pandas * vaex.to_pandas_df diff --git a/doc/source/getting_started/intro_tutorials/04_plotting.rst b/doc/source/getting_started/intro_tutorials/04_plotting.rst index 991c2bbe0fba6..b7a566a35084d 100644 --- a/doc/source/getting_started/intro_tutorials/04_plotting.rst +++ b/doc/source/getting_started/intro_tutorials/04_plotting.rst @@ -131,8 +131,8 @@ standard Python to get an overview of the available plot methods: ] .. note:: - In many development environments as well as ipython and - jupyter notebook, use the TAB button to get an overview of the available + In many development environments as well as IPython and + Jupyter Notebook, use the TAB button to get an overview of the available methods, for example ``air_quality.plot.`` + TAB. One of the options is :meth:`DataFrame.plot.box`, which refers to a diff --git a/doc/source/user_guide/10min.rst b/doc/source/user_guide/10min.rst index 08f83a4674ada..cf548ba5d1133 100644 --- a/doc/source/user_guide/10min.rst +++ b/doc/source/user_guide/10min.rst @@ -239,13 +239,13 @@ Select via the position of the passed integers: df.iloc[3] -By integer slices, acting similar to numpy/python: +By integer slices, acting similar to numpy/Python: .. ipython:: python df.iloc[3:5, 0:2] -By lists of integer position locations, similar to the numpy/python style: +By lists of integer position locations, similar to the NumPy/Python style: .. ipython:: python diff --git a/doc/source/user_guide/basics.rst b/doc/source/user_guide/basics.rst index 53fabf94e24e0..a21e5180004b2 100644 --- a/doc/source/user_guide/basics.rst +++ b/doc/source/user_guide/basics.rst @@ -845,7 +845,7 @@ For example, we can fit a regression using statsmodels. Their API expects a form The pipe method is inspired by unix pipes and more recently dplyr_ and magrittr_, which have introduced the popular ``(%>%)`` (read pipe) operator for R_. -The implementation of ``pipe`` here is quite clean and feels right at home in python. +The implementation of ``pipe`` here is quite clean and feels right at home in Python. We encourage you to view the source code of :meth:`~DataFrame.pipe`. .. _dplyr: https://github.com/hadley/dplyr @@ -2203,7 +2203,7 @@ You can use the :meth:`~DataFrame.astype` method to explicitly convert dtypes fr even if the dtype was unchanged (pass ``copy=False`` to change this behavior). In addition, they will raise an exception if the astype operation is invalid. -Upcasting is always according to the **numpy** rules. If two different dtypes are involved in an operation, +Upcasting is always according to the **NumPy** rules. If two different dtypes are involved in an operation, then the more *general* one will be used as the result of the operation. .. ipython:: python diff --git a/doc/source/user_guide/cookbook.rst b/doc/source/user_guide/cookbook.rst index 939acf10d6c0b..5a6f56388dee5 100644 --- a/doc/source/user_guide/cookbook.rst +++ b/doc/source/user_guide/cookbook.rst @@ -18,9 +18,6 @@ above what the in-line examples offer. pandas (pd) and Numpy (np) are the only two abbreviated imported modules. The rest are kept explicitly imported for newer users. -These examples are written for Python 3. Minor tweaks might be necessary for earlier python -versions. - Idioms ------ @@ -71,7 +68,7 @@ Or use pandas where after you've set up a mask ) df.where(df_mask, -1000) -`if-then-else using numpy's where() +`if-then-else using NumPy's where() `__ .. ipython:: python @@ -1013,7 +1010,7 @@ The :ref:`Plotting ` docs. `Setting x-axis major and minor labels `__ -`Plotting multiple charts in an ipython notebook +`Plotting multiple charts in an IPython Jupyter notebook `__ `Creating a multi-line plot diff --git a/doc/source/user_guide/enhancingperf.rst b/doc/source/user_guide/enhancingperf.rst index cc8de98165fac..39257c06feffe 100644 --- a/doc/source/user_guide/enhancingperf.rst +++ b/doc/source/user_guide/enhancingperf.rst @@ -96,7 +96,7 @@ hence we'll concentrate our efforts cythonizing these two functions. Plain Cython ~~~~~~~~~~~~ -First we're going to need to import the Cython magic function to ipython: +First we're going to need to import the Cython magic function to IPython: .. ipython:: python :okwarning: @@ -123,7 +123,7 @@ is here to distinguish between function versions): .. note:: If you're having trouble pasting the above into your ipython, you may need - to be using bleeding edge ipython for paste to play well with cell magics. + to be using bleeding edge IPython for paste to play well with cell magics. .. code-block:: ipython @@ -160,7 +160,7 @@ We get another huge improvement simply by providing type information: In [4]: %timeit df.apply(lambda x: integrate_f_typed(x["a"], x["b"], x["N"]), axis=1) 10 loops, best of 3: 20.3 ms per loop -Now, we're talking! It's now over ten times faster than the original python +Now, we're talking! It's now over ten times faster than the original Python implementation, and we haven't *really* modified the code. Let's have another look at what's eating up time: diff --git a/doc/source/user_guide/groupby.rst b/doc/source/user_guide/groupby.rst index e8866daa9d99f..87ead5a1b80f0 100644 --- a/doc/source/user_guide/groupby.rst +++ b/doc/source/user_guide/groupby.rst @@ -672,7 +672,7 @@ accepts the special syntax in :meth:`GroupBy.agg`, known as "named aggregation", ) -If your desired output column names are not valid python keywords, construct a dictionary +If your desired output column names are not valid Python keywords, construct a dictionary and unpack the keyword arguments .. ipython:: python @@ -1090,7 +1090,7 @@ will be passed into ``values``, and the group index will be passed into ``index` .. warning:: When using ``engine='numba'``, there will be no "fall back" behavior internally. The group - data and group index will be passed as numpy arrays to the JITed user defined function, and no + data and group index will be passed as NumPy arrays to the JITed user defined function, and no alternative execution attempts will be tried. .. note:: diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index 98c981539d207..2dd8f0cb212b1 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -55,7 +55,7 @@ of multi-axis indexing. *label* of the index. This use is **not** an integer position along the index.). * A list or array of labels ``['a', 'b', 'c']``. - * A slice object with labels ``'a':'f'`` (Note that contrary to usual python + * A slice object with labels ``'a':'f'`` (Note that contrary to usual Python slices, **both** the start and the stop are included, when present in the index! See :ref:`Slicing with labels ` and :ref:`Endpoints are inclusive `.) @@ -327,7 +327,7 @@ The ``.loc`` attribute is the primary access method. The following are valid inp * A single label, e.g. ``5`` or ``'a'`` (Note that ``5`` is interpreted as a *label* of the index. This use is **not** an integer position along the index.). * A list or array of labels ``['a', 'b', 'c']``. -* A slice object with labels ``'a':'f'`` (Note that contrary to usual python +* A slice object with labels ``'a':'f'`` (Note that contrary to usual Python slices, **both** the start and the stop are included, when present in the index! See :ref:`Slicing with labels `. * A boolean array. @@ -509,11 +509,11 @@ For getting a cross section using an integer position (equiv to ``df.xs(1)``): df1.iloc[1] -Out of range slice indexes are handled gracefully just as in Python/Numpy. +Out of range slice indexes are handled gracefully just as in Python/NumPy. .. ipython:: python - # these are allowed in python/numpy. + # these are allowed in Python/NumPy. x = list('abcdef') x x[4:10] diff --git a/doc/source/user_guide/options.rst b/doc/source/user_guide/options.rst index d222297abc70b..c828bc28826b1 100644 --- a/doc/source/user_guide/options.rst +++ b/doc/source/user_guide/options.rst @@ -124,13 +124,13 @@ are restored automatically when you exit the ``with`` block: 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 $IPYTHONDIR/profile_default/startup -More information can be found in the `ipython documentation +More information can be found in the `IPython documentation `__. An example startup script for pandas is displayed below: .. code-block:: python @@ -332,7 +332,7 @@ display.large_repr truncate For DataFrames exceeding ma (the behaviour in earlier versions of pandas). allowable settings, ['truncate', 'info'] display.latex.repr False Whether to produce a latex DataFrame - representation for jupyter frontends + representation for Jupyter frontends that support it. display.latex.escape True Escapes special characters in DataFrames, when using the to_latex method. @@ -413,7 +413,7 @@ display.show_dimensions truncate Whether to print out dimens frame is truncated (e.g. not display all rows and/or columns) display.width 80 Width of the display in characters. - In case python/IPython is running in + In case Python/IPython is running in a terminal this can be set to None and pandas will correctly auto-detect the width. Note that the IPython notebook, diff --git a/doc/source/user_guide/sparse.rst b/doc/source/user_guide/sparse.rst index 3156e3088d860..e4eea57c43dbb 100644 --- a/doc/source/user_guide/sparse.rst +++ b/doc/source/user_guide/sparse.rst @@ -179,7 +179,7 @@ sparse values instead. rather than a SparseSeries or SparseDataFrame. This section provides some guidance on migrating your code to the new style. As a reminder, -you can use the python warnings module to control warnings. But we recommend modifying +you can use the Python warnings module to control warnings. But we recommend modifying your code, rather than ignoring the warning. **Construction**