0

I'm working with a binary file "uint64.bin" whose entire contents can be represented by: 0x0f2d1e6002df9000

My python code is as follows:

import numpy as np
import pandas as pd

my_dtype = np.dtype([('mytag','>u8')])
with open("uint64.bin", 'rb') as fh:
    data = np.fromfile(file=fh, dtype=my_dtype)
df = pd.DataFrame(data, columns=data.dtype.names)
print(df.get_values()[0])

What prints is 1093563682234798080 whereas the output should be 1093563682234798100 (the difference is in the 0x14 bits). What's going on?

I'm on Windows 64-bit and using Python 3.7.

0

1 Answer 1

1

Just do print(0x0f2d1e6002df9000) in Python. It gives you:

1093563682234798080

So the answer you're getting is correct, your assumption about what it should be is incorrect.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.