Little Endian编译器Python不支持Big Endian.如何转换为Big Endian编译器



我在python kde图中使用了seaborn模块。我用了fits文件和天文表。这是我的密码。当我运行代码时,它说Big Endian在Little Endian中不受支持。我可以在我以前的Jupiter笔记本上运行这个,但我再次安装了anaconda jupyter,它现在不工作了。如何使其发挥作用?有什么方法可以让我们拥有BIG ENDIAN编译器吗。我从天文表上换成了熊猫,但它并没有给出正确的结果。我想用天文表。请帮忙。感谢

import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table
import seaborn as sb 
plt.figure(figsize=(14,12))
X=data['ra']
Y=data['dec']
levels=np.arange(0, 0.3 ,0.02)
sb.kdeplot(X,Y,cmap='Reds',hue_order=False,levels=levels,shade=False, shade_lowest=True,gridsize=500, cbar=False,fill=True,annot = True)
plt.scatter(X,Y,s=1.2,color='red')

s=plt.scatter(X, Y,edgecolor='k',lw=3, label='NB926 [OII] emitters',facecolor='None')

plt.xlabel('RA[deg]')
plt.ylabel('DEC[deg]')
plt.gca().invert_xaxis()

如果没有看到更多的细节,比如异常堆栈跟踪,就有点难以确定。但是,这可以在https://github.com/astropy/astropy/issues/11286并固定在https://github.com/astropy/astropy/pull/11288.

一种变通方法可能是

data = Table(data.as_array().byteswap().newbyteorder('='))

最新更新