diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 64c5b735fdc8d..37b7ecad736ee 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -137,7 +137,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.errors.PyperclipWindowsException \ pandas.errors.UnsortedIndexError \ pandas.errors.UnsupportedFunctionCall \ - pandas.show_versions \ pandas.test \ pandas.NaT \ pandas.Timestamp.as_unit \ @@ -170,14 +169,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Period.asfreq \ pandas.Period.now \ pandas.arrays.PeriodArray \ - pandas.Int8Dtype \ - pandas.Int16Dtype \ - pandas.Int32Dtype \ - pandas.Int64Dtype \ - pandas.UInt8Dtype \ - pandas.UInt16Dtype \ - pandas.UInt32Dtype \ - pandas.UInt64Dtype \ pandas.NA \ pandas.CategoricalDtype.categories \ pandas.CategoricalDtype.ordered \ diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py index 85cf282228e06..0e6e7a484bbb7 100644 --- a/pandas/core/arrays/integer.py +++ b/pandas/core/arrays/integer.py @@ -147,6 +147,56 @@ class IntegerArray(NumericArray): Methods ------- None + +Examples +-------- +For Int8Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.Int8Dtype()) +>>> ser.dtype +Int8Dtype() + +For Int16Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.Int16Dtype()) +>>> ser.dtype +Int16Dtype() + +For Int32Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.Int32Dtype()) +>>> ser.dtype +Int32Dtype() + +For Int64Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.Int64Dtype()) +>>> ser.dtype +Int64Dtype() + +For UInt8Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.UInt8Dtype()) +>>> ser.dtype +UInt8Dtype() + +For UInt16Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.UInt16Dtype()) +>>> ser.dtype +UInt16Dtype() + +For UInt32Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.UInt32Dtype()) +>>> ser.dtype +UInt32Dtype() + +For UInt64Dtype: + +>>> ser = pd.Series([2, pd.NA], dtype=pd.UInt64Dtype()) +>>> ser.dtype +UInt64Dtype() """ # create the Dtype diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index b86938dfb6498..e39c2f7badb1d 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -114,6 +114,28 @@ def show_versions(as_json: str | bool = False) -> None: * If str, it will be considered as a path to a file. Info will be written to that file in JSON format. * If True, outputs info in JSON format to the console. + + Examples + -------- + >>> pd.show_versions() # doctest: +SKIP + Your output may look something like this: + INSTALLED VERSIONS + ------------------ + commit : 37ea63d540fd27274cad6585082c91b1283f963d + python : 3.10.6.final.0 + python-bits : 64 + OS : Linux + OS-release : 5.10.102.1-microsoft-standard-WSL2 + Version : #1 SMP Wed Mar 2 00:30:59 UTC 2022 + machine : x86_64 + processor : x86_64 + byteorder : little + LC_ALL : None + LANG : en_GB.UTF-8 + LOCALE : en_GB.UTF-8 + pandas : 2.0.1 + numpy : 1.24.3 + ... """ sys_info = _get_sys_info() deps = _get_dependency_info()