3

When using pandas.io.stata.read_stata or pandas.read_stata I receive:

ValueError: Version of given Stata file is 69. pandas supports importing versions 105, 108, 111 (Stata 7SE), 113 (Stata 8/9), 114 (Stata 10/11), 115 (Stata 12), 117 (Stata 13), 118 (Stata 14/15/16),and 119 (Stata 15/16, over 32,767 variables).

When using pyreadstat.read_dta I receive:

ReadstatError: This version of the file format is not supported

Is there another way to import Stata files of version 69?

  • Do you have access to Stata? Do you have a colleague with access to Stata? Anyone with a recent version of Stata will be able to read this and then `save` it as a more recent version of the data. – Nick Cox Jan 10 '22 at 14:52
  • Hi, thank you for the comment. I figured out, that the problem was due to German floating comma. I had no problems with a converted floating point version of the .dta file. – Fabian Pascher Apr 04 '22 at 14:33
  • @FabianPascher so how exactly did you resolve this? I have the same problem right now – Tendekai Muchenje Aug 21 '23 at 22:13
  • @TendekaiMuchenje 1. Use pd.read_csv to initialize data, I use these parameters: encoding="latin1", sep='\t' 2. Convert number with floating commas individually (Select columns for example like this: 1. Find columns witzh string, i.e.: https://stackoverflow.com/a/64374711/15658660, 2. Convert string's floating comma to floating point, i.e. .apply(lambda x: x.str.replace(',','.')).astype(float)) – Fabian Pascher Aug 23 '23 at 08:42

0 Answers0