Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type conversion, dangerous Int8 data #43

Open
PaulSoderlind opened this issue Sep 11, 2024 · 2 comments
Open

type conversion, dangerous Int8 data #43

PaulSoderlind opened this issue Sep 11, 2024 · 2 comments

Comments

@PaulSoderlind
Copy link

My .dta (STATA) file has some columns as Float32, others as Int8, etc. Especially the Int8 casuses lots of problems in the code (overflow...), so they must be converted to Int64.

Is there a simple way of telling readstat() to do that? (I prefer not to create a df.) If not, I would kindly ask for an option safe_types (or something) that would convert all Intx to Int64 and perhaps also all Floatx to Float64.

@junyuan-chen
Copy link
Owner

Hi! It sounds like the problems you mention occur after the file is loaded, right? Currently, the value types are determined based on the variable-specific metadata in the file. So, you are asking for type conversion at the time of reading the file, without building the columns based on the value types suggested by the metadata. I think this would be a feature to be implemented. It's viable although not readily available at this moment.

@PaulSoderlind
Copy link
Author

Yes, such a feature would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants