class_docstr: Max Drawdown
  
  **Default Inputs:** None
  
  **Default Window Length:** None
class_docstr_tok: ["Max","Drawdown","*","*","Default","Inputs",":","*","*","None","*","*","Default","Window","Length",":","*","*","None"]
code: def compute(self, today, assets, out, data):
      drawdowns = fmax.accumulate(data, axis=0) - data
      drawdowns[isnan(drawdowns)] = NINF
      drawdown_ends = nanargmax(drawdowns, axis=0)
  
      # TODO: Accelerate this loop in Cython or Numba.
      for i, end in enumerate(drawdown_ends):
          peak = nanmax(data[: end + 1, i])
          out[i] = (peak - data[end, i]) / data[end, i]
  
imports: from numbers import Number
  from numpy import arange, average, clip, copyto, exp, fmax, full, isnan, log, NINF, sqrt, sum, unique
  from zipline.pipeline.data import EquityPricing
  from zipline.utils.input_validation import expect_types
  from zipline.utils.math_utils import nanargmax, nanmax, nanmean, nanstd, nansum
  from zipline.utils.numpy_utils import float64_dtype, ignore_nanwarnings
  from .factor import CustomFactor
  from ..mixins import SingleInputMixin
label_desc: Use image node_id 1 for calling the MaxDrawdown obj's underlying member method code with example usage: obj.compute(today, assets, out, data) without return types