Web: https://www.reddit.com/r/datascience/comments/shexex/trying_to_import_uint16_file_but_its_giving_funny/

Jan. 31, 2022, 10:56 p.m. | /u/majorfighter

Data Science reddit.com

I'm trying to import a file named in.dat into python which is an int16 file, however the file is giving some values of greater than 60,000 which seems odd since int16 can only house numbers -32767 to +32767. Some of the values are correct!

import numpy as np
f = open("in.dat", "rb")
a = np.fromfile(f, dtype = np.uint16)
print(a)

The output returns:

[64594 64232 64418 ... 58 51 10]

I have tried testing this in other programming languages e.g. c …

datascience giving values

Data Scientist

@ Fluent, LLC | Boca Raton, Florida, United States

Big Data ETL Engineer

@ Binance.US | Vancouver

Data Scientist / Data Engineer

@ Kin + Carta | Chicago

Data Engineer

@ Craft | Warsaw, Masovian Voivodeship, Poland

Senior Manager, Data Analytics Audit

@ Affirm | Remote US

Data Scientist - Nationwide Opportunities, AWS Professional Services

@ Amazon.com | US, NC, Virtual Location - N Carolina