From c00e5a4e57f6b7a8356a769c34d9feb68e08387d Mon Sep 17 00:00:00 2001 From: Idil Ismiguzel Date: Thu, 1 Dec 2022 20:52:05 +0100 Subject: [PATCH 1/2] add example for read_csv with nullable dtype --- doc/source/user_guide/io.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index a073087f6ec8f..f907242309f89 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -464,6 +464,15 @@ worth trying. os.remove("foo.csv") +.. ipython:: python + + data = """a,b,c,d,e,f,g,h,i,j + 1,2.5,True,a,,,,,12-31-2019, + 3,4.5,False,b,6,7.5,True,a,12-31-2019, + """ + + pd.read_csv(StringIO(data), use_nullable_dtypes=True, parse_dates=["i"]) + .. _io.categorical: Specifying categorical dtype From 0cc7ed7f4b1fd7632e379d8983e943c5f0dc09ba Mon Sep 17 00:00:00 2001 From: Idil Ismiguzel Date: Fri, 2 Dec 2022 00:04:19 +0100 Subject: [PATCH 2/2] add comment for read_csv nullable dtypes example --- doc/source/user_guide/io.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index f907242309f89..f1c212b53a87a 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -464,6 +464,8 @@ worth trying. os.remove("foo.csv") +Setting ``use_nullable_dtypes=True`` will result in nullable dtypes for every column. + .. ipython:: python data = """a,b,c,d,e,f,g,h,i,j