@@ -1280,6 +1280,35 @@ def from_csv(cls, path, header=0, sep=',', index_col=0,
1280
1280
parse_dates = parse_dates , index_col = index_col ,
1281
1281
encoding = encoding )
1282
1282
1283
+ @classmethod
1284
+ def from_dta (dta , path , parse_dates = True , convert_categoricals = True , encoding = None , index_col = None ):
1285
+ """
1286
+ Read Stata file into DataFrame
1287
+
1288
+ Parameters
1289
+ ----------
1290
+ path : string file path or file handle / StringIO
1291
+ parse_dates : boolean, default True
1292
+ Convert date variables to DataFrame time values
1293
+ convert_categoricals : boolean, default True
1294
+ Read value labels and convert columns to Categorical/Factor variables
1295
+ encoding : string, None or encoding, default None
1296
+ Encoding used to parse the files. Note that Stata doesn't
1297
+ support unicode. None defaults to cp1252.
1298
+ index_col : int or sequence, default None
1299
+ Column to use for index. If a sequence is given, a MultiIndex
1300
+ is used. Different default from read_table
1301
+
1302
+ Notes
1303
+ -----
1304
+
1305
+ Returns
1306
+ -------
1307
+ y : DataFrame
1308
+ """
1309
+ from pandas .io .parsers import read_stata
1310
+ return read_stata (path , parse_dates = parse_dates , convert_categoricals = convert_categoricals , encoding = encoding , index = index_col )
1311
+
1283
1312
def to_sparse (self , fill_value = None , kind = 'block' ):
1284
1313
"""
1285
1314
Convert to SparseDataFrame
0 commit comments