Skip to content

Instantly share code, notes, and snippets.

@mwcraig
Created September 13, 2013 05:42
Show Gist options
  • Save mwcraig/6547090 to your computer and use it in GitHub Desktop.
Save mwcraig/6547090 to your computer and use it in GitHub Desktop.
Generates astropy issue #1447
from astropy.table import Table
numbers = [1, 2, 3]
strings = ['a', 'b', 'c']
t_mask_numbers = Table(data=[numbers], masked=True)
comparison_numbers_masked = (t_mask_numbers['col0'] == 1)
type(comparison_numbers_masked) # this is a MaskedColumn object
comparison_numbers_masked # that causes an error on display...
print (comparison_numbers_masked) # ...but can be printed!
t_mask_strings = Table(data=[strings], masked=True)
comparison_strings_masked = (t_mask_strings['col0'] == 'a')
type(comparison_strings_masked) # this is a MaskedColumn object
comparison_strings_masked # that can be displayed...
print (comparison_strings_masked) # ...but not printed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment