Python Forum

Full Version: numpy.str bytes issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm currently using Vizier Query to call the SAO catalog. I've successfully created a script that calls each spectral type, but when I try to plot the B stars, it comes up with this:

startswith first arg must be bytes or a tuple of bytes, not numpy.str_

The code that it refers to is

tbl = tbl[tbl['SpType'] != '']
print(tbl['_RA.icrs'][:4])
print(tbl['_DE.icrs'][:4])
sptype_mask = np.char.startswith(tbl['SpType'], 'O')

I'm unsure how to change the code to get it working. The rest of the script runs perfectly, and the mollweide projection works fine, I just can't plot each spectral type.

Has anybody had this issue with their code?