Skip to content

Commit

Permalink
Add missing ranges (another way to specify missing values in SPSS)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbkranz committed Oct 10, 2023
1 parent 241eb7f commit bbf3c4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/healdata_utils/transforms/readstat/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def convert_readstat(file_path,
missing_values.append(str(values[0]))
else:
missing_values.append(values[0])
# missing_ranges is in readstat for spss
elif list(items.keys()) == ["lo","hi"]:
values = list(range(int(items["lo"]),int(items["hi"])+1))
missing_values.extend(values)
else:
raise Exception("Currently, only discrete values are supported")

Expand Down

0 comments on commit bbf3c4d

Please sign in to comment.