Skip to content

docs: removed wrong value in pd.NA ** 0 #31004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b7fcb54
CLN: remove unnecessary overriding in subclasses (#30875)
jbrockmendel Jan 10, 2020
6f2c509
DEPR: fix missing stacklevel in pandas.core.index deprecation (#30878)
jorisvandenbossche Jan 10, 2020
d1b9598
DOC: Encourage use of pre-commit in the docs (#30864)
gfyoung Jan 10, 2020
447a3b0
WEB: Removing Discourse links (#30890)
datapythonista Jan 10, 2020
03cdcb6
WEB: Remove from roadmap moving the docstring script (#30893)
datapythonista Jan 10, 2020
0b4bac7
TYP: typing annotations (#30901)
ShaharNaveh Jan 10, 2020
f887eb0
TYP: offsets (#30897)
jbrockmendel Jan 10, 2020
6e9651e
BUG: pickle files left behind by tm.round_trip_pickle (#30906)
jbrockmendel Jan 11, 2020
7f2948c
replace syntax with f-string (#30919)
HH-MWB Jan 11, 2020
939e7dd
CLN: F-strings (#30916)
dinasv Jan 11, 2020
b47a454
DOC: Fixture docs in pandas/conftest.py (#30917)
gfyoung Jan 11, 2020
75ecfa4
CLN: remove unnecesary _date_check_type (#30932)
jbrockmendel Jan 11, 2020
044559a
DOC: Fix SS03 docstring error (#30939)
galuhsahid Jan 12, 2020
28e909c
TYP: type up parts of series.py (#30761)
topper-123 Jan 12, 2020
4e2546d
STY: wrong placed space in strings (#30940)
ShaharNaveh Jan 12, 2020
45580a2
DOC: Fix whatsnew contributors section (#30926)
jschendel Jan 13, 2020
439d629
CI: numpydev changed double to single quote (#30952)
jbrockmendel Jan 13, 2020
46c2864
CLN: leftover ix checks (#30951)
jbrockmendel Jan 13, 2020
bbccf2d
DOC: Move import conventions from wiki to docs #30808 (#30888)
souvik3333 Jan 13, 2020
2c76d06
DOC: Move couple of deprecations whatsnew to correct section (#30961)
ryankarlos Jan 13, 2020
62d16ab
STY: concat strings that should not be seperated (#30942)
ShaharNaveh Jan 13, 2020
dd6e31a
REGR: Fixed hash_key=None for object values (#30900)
TomAugspurger Jan 13, 2020
bd63ece
CLN: remove no-op from indexing (#30934)
jbrockmendel Jan 13, 2020
7ba53f0
BUG: -1 to the power of pd.NA was returning -1 (#30960)
MarcoGorelli Jan 13, 2020
67fcdef
TYP: NDFrame.resample (#30947)
topper-123 Jan 13, 2020
993fdbe
DOC: whatsnew for 1.1 (#30972)
WillAyd Jan 13, 2020
6928327
CLN: misc cleanups (#30877)
jbrockmendel Jan 13, 2020
2bf0c9f
Compat for util.testing import (#30973)
TomAugspurger Jan 13, 2020
307137c
STY: concat strings (#30979)
ShaharNaveh Jan 13, 2020
2075539
Added small corrections to the test for interpolate limit_area (#30987)
cchwala Jan 13, 2020
8ff2ebd
STY: concat strings (#30991)
ShaharNaveh Jan 14, 2020
13b22fd
CLN: de-duplicate _getitem_scalar (#30992)
jbrockmendel Jan 14, 2020
0f048cb
CLN: remove geopandas compat code (#30909)
jbrockmendel Jan 14, 2020
b18024d
STY: Whitespaces placed at the beginning instead at the end of a line…
ShaharNaveh Jan 14, 2020
3471270
API: Disallow NaN in StringArray constructor (#30980)
TomAugspurger Jan 14, 2020
81d9636
BUG: ensure_datetime64ns with bigendian array (#30976)
jbrockmendel Jan 14, 2020
7d24b1c
docs: correct wrong result in pd.NA ** 0
tsvikas Jan 14, 2020
33d198d
Merge branch '1.0.x' into docs-na-pow
tsvikas Jan 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions doc/source/development/code_style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,29 @@ For example:

value = str
f"Unknown recived type, got: '{type(value).__name__}'"


Imports (aim for absolute)
==========================

In Python 3, absolute imports are recommended. In absolute import doing something
like ``import string`` will import the string module rather than ``string.py``
in the same directory. As much as possible, you should try to write out
absolute imports that show the whole import chain from toplevel pandas.

Explicit relative imports are also supported in Python 3. But it is not
recommended to use it. Implicit relative imports should never be used
and is removed in Python 3.

For example:

::

# preferred
import pandas.core.common as com

# not preferred
from .common import test_base

# wrong
from common import test_base
51 changes: 36 additions & 15 deletions doc/source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ many errors as possible, but it may not correct *all* of them. Thus, it is
recommended that you run ``cpplint`` to double check and make any other style
fixes manually.

.. _contributing.code-formatting:

Python (PEP8 / black)
~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -656,27 +658,16 @@ apply ``black`` as you edit files.
You should use a ``black`` version >= 19.10b0 as previous versions are not compatible
with the pandas codebase.

Optionally, you may wish to setup `pre-commit hooks <https://pre-commit.com/>`_
to automatically run ``black`` and ``flake8`` when you make a git commit. This
can be done by installing ``pre-commit``::

pip install pre-commit

and then running::

pre-commit install

from the root of the pandas repository. Now ``black`` and ``flake8`` will be run
each time you commit changes. You can skip these checks with
``git commit --no-verify``.
If you wish to run these checks automatically, we encourage you to use
:ref:`pre-commits <contributing.pre-commit>` instead.

One caveat about ``git diff upstream/master -u -- "*.py" | flake8 --diff``: this
command will catch any stylistic errors in your changes specifically, but
be beware it may not catch all of them. For example, if you delete the only
usage of an imported function, it is stylistically incorrect to import an
unused function. However, style-checking the diff will not catch this because
the actual import is not part of the diff. Thus, for completeness, you should
run this command, though it will take longer::
run this command, though it may take longer::

git diff upstream/master --name-only -- "*.py" | xargs -r flake8

Expand All @@ -694,6 +685,8 @@ behaviour as follows::
This will get all the files being changed by the PR (and ending with ``.py``),
and run ``flake8`` on them, one after the other.

Note that these commands can be run analogously with ``black``.

.. _contributing.import-formatting:

Import formatting
Expand All @@ -716,7 +709,6 @@ A summary of our current import sections ( in order ):

Imports are alphabetically sorted within these sections.


As part of :ref:`Continuous Integration <contributing.ci>` checks we run::

isort --recursive --check-only pandas
Expand All @@ -740,8 +732,37 @@ to automatically format imports correctly. This will modify your local copy of t

The `--recursive` flag can be passed to sort all files in a directory.

Alternatively, you can run a command similar to what was suggested for ``black`` and ``flake8`` :ref:`right above <contributing.code-formatting>`::

git diff upstream/master --name-only -- "*.py" | xargs -r isort

Where similar caveats apply if you are on OSX or Windows.

You can then verify the changes look ok, then git :ref:`commit <contributing.commit-code>` and :ref:`push <contributing.push-code>`.

.. _contributing.pre-commit:

Pre-Commit
~~~~~~~~~~

You can run many of these styling checks manually as we have described above. However,
we encourage you to use `pre-commit hooks <https://pre-commit.com/>`_ instead
to automatically run ``black``, ``flake8``, ``isort`` when you make a git commit. This
can be done by installing ``pre-commit``::

pip install pre-commit

and then running::

pre-commit install

from the root of the pandas repository. Now all of the styling checks will be
run each time you commit changes without your needing to run each one manually.
In addition, using this pre-commit hook will also allow you to more easily
remain up-to-date with our code checks as they change.

Note that if needed, you can skip these checks with ``git commit --no-verify``.

Backwards compatibility
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
14 changes: 0 additions & 14 deletions doc/source/development/roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@ Some specific goals include
* Improve the overall organization of the documentation and specific subsections
of the documentation to make navigation and finding content easier.

Package docstring validation
----------------------------

To improve the quality and consistency of pandas docstrings, we've developed
tooling to check docstrings in a variety of ways.
https://github.com/pandas-dev/pandas/blob/master/scripts/validate_docstrings.py
contains the checks.

Like many other projects, pandas uses the
`numpydoc <https://numpydoc.readthedocs.io/en/latest/>`__ style for writing
docstrings. With the collaboration of the numpydoc maintainers, we'd like to
move the checks to a package other than pandas so that other projects can easily
use them as well.

Performance monitoring
----------------------

Expand Down
4 changes: 2 additions & 2 deletions doc/source/index.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See the :ref:`overview` for more detail about what's in the library.
:hidden:
{% endif %}
{% if not single_doc %}
What's New in 1.0.0 <whatsnew/v1.0.0>
What's New in 1.1.0 <whatsnew/v1.1.0>
getting_started/index
user_guide/index
{% endif -%}
Expand All @@ -51,7 +51,7 @@ See the :ref:`overview` for more detail about what's in the library.
whatsnew/index
{% endif %}

* :doc:`whatsnew/v1.0.0`
* :doc:`whatsnew/v1.1.0`
* :doc:`getting_started/index`

* :doc:`getting_started/install`
Expand Down
9 changes: 3 additions & 6 deletions doc/source/user_guide/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -825,13 +825,10 @@ For example, ``pd.NA`` propagates in arithmetic operations, similarly to
There are a few special cases when the result is known, even when one of the
operands is ``NA``.

.. ipython:: python

================ ======
Operation Result
================ ======
``pd.NA ** 0`` 0
``1 ** pd.NA`` 1
================ ======
pd.NA ** 0
1 ** pd.NA

In equality and comparison operations, ``pd.NA`` also propagates. This deviates
from the behaviour of ``np.nan``, where comparisons with ``np.nan`` always
Expand Down
8 changes: 8 additions & 0 deletions doc/source/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ This is the list of changes to pandas between each release. For full details,
see the commit logs at http://github.com/pandas-dev/pandas. For install and
upgrade instructions, see :ref:`install`.

Version 1.1
-----------

.. toctree::
:maxdepth: 2

v1.1.0

Version 1.0
-----------

Expand Down
168 changes: 168 additions & 0 deletions doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
.. _whatsnew_110:

What's new in 1.1.0 (??)
------------------------

These are the changes in pandas 1.1.0. See :ref:`release` for a full changelog
including other versions of pandas.

{{ header }}

.. ---------------------------------------------------------------------------

Enhancements
~~~~~~~~~~~~

.. _whatsnew_110.enhancements.other:

Other enhancements
^^^^^^^^^^^^^^^^^^

-
-


.. ---------------------------------------------------------------------------

.. _whatsnew_110.deprecations:

Deprecations
~~~~~~~~~~~~

-
-

.. ---------------------------------------------------------------------------


.. _whatsnew_110.performance:

Performance improvements
~~~~~~~~~~~~~~~~~~~~~~~~

-
-

.. ---------------------------------------------------------------------------

.. _whatsnew_110.bug_fixes:

Bug fixes
~~~~~~~~~


Categorical
^^^^^^^^^^^

-
-

Datetimelike
^^^^^^^^^^^^
-
-

Timedelta
^^^^^^^^^

-
-

Timezones
^^^^^^^^^

-
-


Numeric
^^^^^^^
-
-

Conversion
^^^^^^^^^^
- Bug in :class:`Series` construction from NumPy array with big-endian ``datetime64`` dtype (:issue:`29684`)
-
-

Strings
^^^^^^^

-
-


Interval
^^^^^^^^

-
-

Indexing
^^^^^^^^

-
-

Missing
^^^^^^^

-
-

MultiIndex
^^^^^^^^^^

-
-

I/O
^^^

-
-

Plotting
^^^^^^^^

-
-

Groupby/resample/rolling
^^^^^^^^^^^^^^^^^^^^^^^^

-
-


Reshaping
^^^^^^^^^

-
-

Sparse
^^^^^^

-
-

ExtensionArray
^^^^^^^^^^^^^^

-
-


Other
^^^^^
-
-

.. ---------------------------------------------------------------------------

.. _whatsnew_110.contributors:

Contributors
~~~~~~~~~~~~
9 changes: 3 additions & 6 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
raise ImportError(
f"C extension: {module} not built. If you want to import "
"pandas from the source directory, you may need to run "
"'python setup.py build_ext --inplace --force' to build "
"the C extensions first."
"'python setup.py build_ext --inplace --force' to build the C extensions first."
)

from pandas._config import (
Expand Down Expand Up @@ -198,8 +197,7 @@ def __getattr__(name):

warnings.warn(
"The Panel class is removed from pandas. Accessing it "
"from the top-level namespace will also be removed in "
"the next version",
"from the top-level namespace will also be removed in the next version",
FutureWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -238,8 +236,7 @@ class Panel:
elif name in {"SparseSeries", "SparseDataFrame"}:
warnings.warn(
f"The {name} class is removed from pandas. Accessing it from "
"the top-level namespace will also be removed in the next "
"version",
"the top-level namespace will also be removed in the next version",
FutureWarning,
stacklevel=2,
)
Expand Down
Loading