class_docstr: Map-reduce way of calculating the mean of a stream of values.
  
  `partial_result` represents one of two things, depending on the axis:
  Case 1 - axis 0 is aggregated (axis is None or 0):
      First sum values according to axis and keep track of number of entries
      summed over (`n`) to divide by in the end.
  
  Case 2 - axis 0 is not being aggregated:
      In this case, `partial_result` is a list of means that in the end gets
      concatenated to a np.ndarray. As this directly calculates the mean,
      `n` is not used.
code: def step(self, values: np.ndarray) -> None:
      assert self.axis is None or isinstance(self.axis, tuple)
  
      if self.axis is None or 0 in self.axis:
          summed_values = np.ma.sum(values, axis=self.axis)
          if self.partial_result is None:
              self.partial_result = np.zeros(summed_values.shape)
              if self.axis is None:
                  self.n = 0
              else:
                  self.n = np.zeros(summed_values.shape)
  
          self.partial_result += summed_values
          self.n += np.ma.count(values, axis=self.axis)
      else:
          if self.partial_result is None:
              self.partial_result = []
  
          mean_values = np.nanmean(values, axis=self.axis)
          assert isinstance(self.partial_result, list)
          self.partial_result.append(mean_values)
  
file_path: gluonts/src/gluonts/ev/aggregations.py
imports: from dataclasses import dataclass
  from typing import List, Optional, Union
  import numpy
label_desc: Use image node_id 1 for calling the Mean obj's underlying member method code with example usage: obj.step(values) without return types