class_docstr: Meant to be passed as the `cls` kwarg to json.dumps(obj, cls=..)
  
  See PlotlyJSONEncoder.default for more implementation information.
  
  Additionally, this encoder overrides nan functionality so that 'Inf',
  'NaN' and '-Inf' encode to 'null'. Which is stricter JSON than the Python
  version.
class_docstr_tok: ["Meant","to","be","passed","as","the","`","cls","`","kwarg","to","json.dumps","(","obj",",","cls=","..",")","See","PlotlyJSONEncoder.default","for","more","implementation","information",".","Additionally",",","this","encoder","overrides","nan","functionality","so","that","'Inf","'",",","'NaN","'","and","'-Inf","'","encode","to","'null","'",".","Which","is","stricter","JSON","than","the","Python","version","."]
docstr: Attempt to convert numpy.ma.core.masked
docstr_tok: ["Attempt","to","convert","numpy.ma.core.masked"]
code: def encode_as_numpy(obj):
      """Attempt to convert numpy.ma.core.masked"""
      numpy = get_module("numpy", should_load=False)
      if not numpy:
          raise NotEncodable
  
      if obj is numpy.ma.core.masked:
          return float("nan")
      else:
          raise NotEncodable
  
imports: import decimal
  import json
  import sys
  import re
  from functools import reduce
  from _plotly_utils.optional_imports import get_module
  from _plotly_utils.basevalidators import ImageUriValidator
label_desc: Use image node_id 8 for calling the PlotlyJSONEncoder obj's underlying member method code with example usage: obj.encode_as_numpy(obj) and returns: float