K
K
kirillcka_markoff2021-11-30 08:29:33
Python
kirillcka_markoff, 2021-11-30 08:29:33

How to convert UINT to SINT in python?

Good afternoon, I have a file with data written in UINT16, how can I interpret it with SINT16?
Sample data:
00151, 14314, 00001, 01385, 64987, 62854, 00064, 00025, 00006, 12202, 06172, 57800

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-11-30
@kirillcka_markoff

You can use numpy

import numpy as np

numbers = '00151', '14314', '00001', '01385', '64987', '62854', '00064', '00025', '00006', '12202', '06172', '57800'

for n in numbers:
    print(np.int16(n))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question