|  | 
| 22 | 22 | import numpy as np | 
| 23 | 23 | 
 | 
| 24 | 24 | from pandas._libs.lib import infer_dtype | 
| 25 |  | -from pandas._libs.tslibs import NaT, Timestamp | 
| 26 | 25 | from pandas._libs.writers import max_len_string_array | 
| 27 | 26 | from pandas.compat import lmap, lrange, lzip | 
| 28 | 27 | from pandas.util._decorators import Appender, deprecate_kwarg | 
|  | 
| 31 | 30 |  ensure_object, is_categorical_dtype, is_datetime64_dtype) | 
| 32 | 31 | 
 | 
| 33 | 32 | from pandas import ( | 
| 34 |  | - DatetimeIndex, compat, concat, isna, to_datetime, to_timedelta) | 
| 35 |  | -from pandas.core.arrays import Categorical | 
|  | 33 | + Categorical, DatetimeIndex, NaT, Timestamp, compat, concat, isna, | 
|  | 34 | + to_datetime, to_timedelta) | 
| 36 | 35 | from pandas.core.base import StringMixin | 
| 37 | 36 | from pandas.core.frame import DataFrame | 
| 38 | 37 | from pandas.core.series import Series | 
| @@ -1050,7 +1049,7 @@ def _read_new_header(self, first_char): | 
| 1050 | 1049 | 
 | 
| 1051 | 1050 |  self.nobs = self._get_nobs() | 
| 1052 | 1051 |  self.path_or_buf.read(11) # </N><label> | 
| 1053 |  | - self.data_label = self._get_data_label() | 
|  | 1052 | + self._data_label = self._get_data_label() | 
| 1054 | 1053 |  self.path_or_buf.read(19) # </label><timestamp> | 
| 1055 | 1054 |  self.time_stamp = self._get_time_stamp() | 
| 1056 | 1055 |  self.path_or_buf.read(26) # </timestamp></header><map> | 
| @@ -1237,7 +1236,7 @@ def _read_old_header(self, first_char): | 
| 1237 | 1236 |  self.path_or_buf.read(2))[0] | 
| 1238 | 1237 |  self.nobs = self._get_nobs() | 
| 1239 | 1238 | 
 | 
| 1240 |  | - self.data_label = self._get_data_label() | 
|  | 1239 | + self._data_label = self._get_data_label() | 
| 1241 | 1240 | 
 | 
| 1242 | 1241 |  self.time_stamp = self._get_time_stamp() | 
| 1243 | 1242 | 
 | 
| @@ -1740,11 +1739,12 @@ def _do_convert_categoricals(self, data, value_label_dict, lbllist, | 
| 1740 | 1739 |  data = DataFrame.from_dict(OrderedDict(cat_converted_data)) | 
| 1741 | 1740 |  return data | 
| 1742 | 1741 | 
 | 
|  | 1742 | + @property | 
| 1743 | 1743 |  def data_label(self): | 
| 1744 | 1744 |  """ | 
| 1745 | 1745 |  Return data label of Stata file. | 
| 1746 | 1746 |  """ | 
| 1747 |  | - return self.data_label | 
|  | 1747 | + return self._data_label | 
| 1748 | 1748 | 
 | 
| 1749 | 1749 |  def variable_labels(self): | 
| 1750 | 1750 |  """ | 
|  | 
0 commit comments