pandas.io.stata.StataReader.data_label #

属性 StataReader。数据标签[来源] #

返回Stata文件的数据标签。

例子

>>> 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.