From 3f423cd12efa69bebf43e0fda397952339a2ad79 Mon Sep 17 00:00:00 2001 From: sunlight <138234530+sunlight798@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:14:11 +0800 Subject: [PATCH] DOC: fix RT03,SA01,ES01 for pandas.io.stata.StataReader.variable_labels (#60008) --- ci/code_checks.sh | 1 - pandas/io/stata.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 6fb675069e81d..79a8cbdf3ea05 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -154,7 +154,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.errors.ValueLabelTypeMismatch SA01" \ -i "pandas.infer_freq SA01" \ -i "pandas.io.json.build_table_schema PR07,RT03,SA01" \ - -i "pandas.io.stata.StataReader.variable_labels RT03,SA01" \ -i "pandas.io.stata.StataWriter.write_file SA01" \ -i "pandas.json_normalize RT03,SA01" \ -i "pandas.plotting.andrews_curves RT03,SA01" \ diff --git a/pandas/io/stata.py b/pandas/io/stata.py index f1d289726c9c8..04bd1e32603f4 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -2045,9 +2045,19 @@ def variable_labels(self) -> dict[str, str]: """ Return a dict associating each variable name with corresponding label. + This method retrieves variable labels from a Stata file. Variable labels are + mappings between variable names and their corresponding descriptive labels + in a Stata dataset. + Returns ------- dict + A python dictionary. + + See Also + -------- + read_stata : Read Stata file into DataFrame. + DataFrame.to_stata : Export DataFrame object to Stata dta format. Examples --------