From 2981bc5175665fc9de1d0294da787bbe8cf93dc2 Mon Sep 17 00:00:00 2001 From: "Kim, KwonHyun" Date: Sat, 9 Apr 2022 09:13:21 +0900 Subject: [PATCH 1/4] DOC: sample variance -> population variance (#46482) --- doc/source/user_guide/gotchas.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/gotchas.rst b/doc/source/user_guide/gotchas.rst index f4cef88072afa..694ae235ece39 100644 --- a/doc/source/user_guide/gotchas.rst +++ b/doc/source/user_guide/gotchas.rst @@ -367,7 +367,7 @@ integer arrays to floating when NAs must be introduced. Differences with NumPy ---------------------- For :class:`Series` and :class:`DataFrame` objects, :meth:`~DataFrame.var` normalizes by -``N-1`` to produce unbiased estimates of the sample variance, while NumPy's +``N-1`` to produce unbiased estimates of the population variance, while NumPy's :meth:`numpy.var` normalizes by N, which measures the variance of the sample. Note that :meth:`~DataFrame.cov` normalizes by ``N-1`` in both pandas and NumPy. From e6fc01a9663f8f76f93e28ed12ad207ca15fb386 Mon Sep 17 00:00:00 2001 From: kwhkim Date: Thu, 14 Apr 2022 21:03:54 +0900 Subject: [PATCH 2/4] DOC: population variance wiki link added (#46710) --- doc/source/user_guide/gotchas.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/gotchas.rst b/doc/source/user_guide/gotchas.rst index 694ae235ece39..adb40e166eab4 100644 --- a/doc/source/user_guide/gotchas.rst +++ b/doc/source/user_guide/gotchas.rst @@ -367,7 +367,7 @@ integer arrays to floating when NAs must be introduced. Differences with NumPy ---------------------- For :class:`Series` and :class:`DataFrame` objects, :meth:`~DataFrame.var` normalizes by -``N-1`` to produce unbiased estimates of the population variance, while NumPy's +``N-1`` to produce `unbiased estimates of the population variance `__, while NumPy's :meth:`numpy.var` normalizes by N, which measures the variance of the sample. Note that :meth:`~DataFrame.cov` normalizes by ``N-1`` in both pandas and NumPy. From b4f97feacc4821a711d01a1f5aa58a2490a81cc2 Mon Sep 17 00:00:00 2001 From: kwhkim Date: Tue, 26 Apr 2022 11:15:32 +0900 Subject: [PATCH 3/4] DOC: Index w/ duplicate into set (#46440) --- doc/source/user_guide/indexing.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index a94681924d211..f8c93c04c980a 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -1553,9 +1553,7 @@ Index objects ------------- The pandas :class:`~pandas.Index` class and its subclasses can be viewed as -implementing an *ordered multiset*. Duplicates are allowed. However, if you try -to convert an :class:`~pandas.Index` object with duplicate entries into a -``set``, an exception will be raised. +implementing an *ordered multiset*. Duplicates are allowed. :class:`~pandas.Index` also provides the infrastructure necessary for lookups, data alignment, and reindexing. The easiest way to create an From 65056822a0c5f7c43f0b70dc5594069ee9fd3779 Mon Sep 17 00:00:00 2001 From: kwhkim Date: Tue, 26 Apr 2022 12:55:05 +0900 Subject: [PATCH 4/4] Revert "DOC: Index w/ duplicate into set (#46440)" This reverts commit b4f97feacc4821a711d01a1f5aa58a2490a81cc2. --- doc/source/user_guide/indexing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/user_guide/indexing.rst b/doc/source/user_guide/indexing.rst index f8c93c04c980a..a94681924d211 100644 --- a/doc/source/user_guide/indexing.rst +++ b/doc/source/user_guide/indexing.rst @@ -1553,7 +1553,9 @@ Index objects ------------- The pandas :class:`~pandas.Index` class and its subclasses can be viewed as -implementing an *ordered multiset*. Duplicates are allowed. +implementing an *ordered multiset*. Duplicates are allowed. However, if you try +to convert an :class:`~pandas.Index` object with duplicate entries into a +``set``, an exception will be raised. :class:`~pandas.Index` also provides the infrastructure necessary for lookups, data alignment, and reindexing. The easiest way to create an