From 7ca8e172fd1216c7a964c9e69d9f80a5a0c712a9 Mon Sep 17 00:00:00 2001 From: sunlight798 <3281498087@qq.com> Date: Wed, 9 Oct 2024 23:21:35 +0800 Subject: [PATCH] DOC: fix RT03,SA01,ES01 for pandas.io.stata.StataReader.variable_labels --- 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 --------