pandas.io.stata.StataReader.data_label#

property StataReader.data_label[source]#

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_labels

Return a dict associating each variable name with corresponding label.

DataFrame.to_stata

Export DataFrame object to Stata dta format.

Examples

>>> df = pd.DataFrame([(1,)], columns=["variable"])
>>> time_stamp = pd.Timestamp(2000, 2, 29, 14, 21)
>>> data_label = "This is a data file."
>>> path = "/My_path/filename.dta"
>>> df.to_stata(
...     path,
...     time_stamp=time_stamp,  
...     data_label=data_label,  
...     version=None,
... )  
>>> with pd.io.stata.StataReader(path) as reader:  
...     print(reader.data_label)  
This is a data file.