A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Roche/pyreadstat/issues/67 below:

Not able to read sav file · Issue #67 · Roche/pyreadstat · GitHub

I am not able to load a sav file when I read it using pyreadstat. Can you please look into this and let me know what is happening.

Below is the code that I am using

import pyreadstat
df, meta = pyreadstat.read_sav('Test.sav')

It gives be below error
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 48-49: unexpected end of data

Some additional info
File to reproduce issue - https://we.tl/t-hYNiVZ7ttC
How did you install pyreadstat? - pip
pyreadstat version - 1.0.0
Platform - Windows 10
Python Version - 3.8
Python Distribution - Plain python

I have 3 questions here. These may seem very amateur but please do answer them if time permits.

  1. Is this something because of different unicode formatting? Can this be handled directly using this module. I know there are options to change encoding but I am not sure if it can be applied on particular data or entire datasets
  2. Is there a quick way to identify unicode formatting for a text
  3. Currently I use a list and usecols options to filter out these bad variables so that at least I get the rest of data. Is there a better way to do than my approach

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4