@@ -82,6 +82,8 @@ def setUp(self):
82
82
self .dta22_118 = os .path .join (self .dirpath , 'stata14_118.dta' )
83
83
self .dta23 = os .path .join (self .dirpath , 'stata15.dta' )
84
84
85
+ self .dta24_111 = os .path .join (self .dirpath , 'stata7_111.dta' )
86
+
85
87
def read_dta (self , file ):
86
88
# Legacy default reader configuration
87
89
return read_stata (file , convert_dates = True )
@@ -1219,6 +1221,19 @@ def test_repeated_column_labels(self):
1219
1221
read_stata (self .dta23 , convert_categoricals = True )
1220
1222
tm .assertTrue ('wolof' in cm .exception )
1221
1223
1224
+ def test_stata_111 (self ):
1225
+ # 111 is an old version but still used by current versions of
1226
+ # SAS when exporting to Stata format. We do not know of any
1227
+ # on-line documentation for this version.
1228
+ df = read_stata (self .dta24_111 )
1229
+ original = pd .DataFrame ({'y' : [1 ,1 ,1 ,1 ,1 ,0 ,0 ,np .NaN ,0 ,0 ],
1230
+ 'x' : [1 ,2 ,1 ,3 ,np .NaN ,4 ,3 ,5 ,1 ,6 ],
1231
+ 'w' : [2 ,np .NaN ,5 ,2 ,4 ,4 ,3 ,1 ,2 ,3 ],
1232
+ 'z' : ['a' ,'b' ,'c' ,'d' ,'e' ,'' ,'g' ,'h' ,'i' ,'j' ]})
1233
+ original = original [['y' , 'x' , 'w' , 'z' ]]
1234
+ tm .assert_frame_equal (original , df )
1235
+
1236
+
1222
1237
if __name__ == '__main__' :
1223
1238
nose .runmodule (argv = [__file__ , '-vvs' , '-x' , '--pdb' , '--pdb-failure' ],
1224
1239
exit = False )
0 commit comments