From ee6ded36fdb1ef20e78b0a6017ec20bad07670e2 Mon Sep 17 00:00:00 2001 From: Daniel Saxton Date: Thu, 20 Aug 2020 17:06:42 -0500 Subject: [PATCH 1/2] Update SparseDtype user guide doc --- doc/source/user_guide/sparse.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/sparse.rst b/doc/source/user_guide/sparse.rst index ca8e9a2f313f6..835a76f1a6117 100644 --- a/doc/source/user_guide/sparse.rst +++ b/doc/source/user_guide/sparse.rst @@ -91,7 +91,7 @@ A :class:`SparseDtype` may be constructed by passing each of these .. ipython:: python - pd.SparseDtype(np.dtype('datetime64[ns]')) + pd.SparseDtype(np.dtype('datetime64[ns]'), pd.NaT) The default fill value for a given NumPy dtype is the "missing" value for that dtype, though it may be overridden. From e669013f1d1716519376794655e8bfac337f2f32 Mon Sep 17 00:00:00 2001 From: Daniel Saxton Date: Sun, 23 Aug 2020 09:36:04 -0500 Subject: [PATCH 2/2] Reword --- doc/source/user_guide/sparse.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/source/user_guide/sparse.rst b/doc/source/user_guide/sparse.rst index 835a76f1a6117..35e0e0fb86472 100644 --- a/doc/source/user_guide/sparse.rst +++ b/doc/source/user_guide/sparse.rst @@ -87,14 +87,15 @@ The :attr:`SparseArray.dtype` property stores two pieces of information sparr.dtype -A :class:`SparseDtype` may be constructed by passing each of these +A :class:`SparseDtype` may be constructed by passing only a dtype .. ipython:: python - pd.SparseDtype(np.dtype('datetime64[ns]'), pd.NaT) + pd.SparseDtype(np.dtype('datetime64[ns]')) -The default fill value for a given NumPy dtype is the "missing" value for that dtype, -though it may be overridden. +in which case a default fill value will be used (for NumPy dtypes this is often the +"missing" value for that dtype). To override this default an explicit fill value may be +passed instead .. ipython:: python