MCPcopy
hub / github.com/pandas-dev/pandas / data_label

Method data_label

pandas/io/stata.py:1963–1994  ·  view source on GitHub ↗

Return data label of Stata file. The data label is a descriptive string associated with the dataset stored in the Stata file. This property provides access to that label, if one is present. See Also -------- io.stata.StataReader.variable_lab

(self)

Source from the content-addressed store, hash-verified

1961
1962 @property
1963 def data_label(self) -> str:
1964 """
1965 Return data label of Stata file.
1966
1967 The data label is a descriptive string associated with the dataset
1968 stored in the Stata file. This property provides access to that
1969 label, if one is present.
1970
1971 See Also
1972 --------
1973 io.stata.StataReader.variable_labels : Return a dict associating each variable
1974 name with corresponding label.
1975 DataFrame.to_stata : Export DataFrame object to Stata dta format.
1976
1977 Examples
1978 --------
1979 >>> df = pd.DataFrame([(1,)], columns=["variable"])
1980 >>> time_stamp = pd.Timestamp(2000, 2, 29, 14, 21)
1981 >>> data_label = "This is a data file."
1982 >>> path = "/My_path/filename.dta"
1983 >>> df.to_stata(
1984 ... path,
1985 ... time_stamp=time_stamp, # doctest: +SKIP
1986 ... data_label=data_label, # doctest: +SKIP
1987 ... version=None,
1988 ... ) # doctest: +SKIP
1989 >>> with pd.io.stata.StataReader(path) as reader: # doctest: +SKIP
1990 ... print(reader.data_label) # doctest: +SKIP
1991 This is a data file.
1992 """
1993 self._ensure_open()
1994 return self._data_label
1995
1996 @property
1997 def time_stamp(self) -> str:

Callers

nothing calls this directly

Calls 1

_ensure_openMethod · 0.95

Tested by

no test coverage detected