Skip to content

Instantly share code, notes, and snippets.

@dkirkby
Created August 10, 2023 21:23
Show Gist options
  • Save dkirkby/2aea277f61cdec820ef1e461d169ceb6 to your computer and use it in GitHub Desktop.
Save dkirkby/2aea277f61cdec820ef1e461d169ceb6 to your computer and use it in GitHub Desktop.
Create pandas dataframe from FITS table
# Need to convert from big-endian to little-endian to avoid this error:
# ValueError: Big-endian buffer not supported on little-endian compiler
data = fitsio.read(path).byteswap().newbyteorder()
df = pd.DataFrame(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment