class_docstr: Add the number of 'trailing' zeros in each univariate time series as a
  feature, to be used when dealing with sparse (intermittent) time series.
  
  For example, for 1-d a time series `[0, 0, 2, 3, 0]`, the number of
  trailing zeros will be 1. If an n-dimensional array is provided, the first
  1-d array along the `axis` dimension will be checked for trailing zeros.
  For example, if axis is set to 1 for a 3-d array A, the transformation
  will return the number of trailing zeros in `A[0, :, 0]`.
  
  Parameters
  ----------
  new_field
      Name of the new field to be created, which will contain the number of
      trailing zeros.
  target_field
      Field with target values (array) of time series
  as_array
      if True, the returned field will be a numpy array of shape (1,)
class_docstr_tok: ["Add","the","number","of","'trailing","'","zeros","in","each","univariate","time","series","as","a","feature",",","to","be","used","when","dealing","with","sparse","(","intermittent",")","time","series",".","For","example",",","for","1-d","a","time","series","`","[","0",",","0",",","2",",","3",",","0","]","`",",","the","number","of","trailing","zeros","will","be","1",".","If","an","n-dimensional","array","is","provided",",","the","first","1-d","array","along","the","`","axis","`","dimension","will","be","checked","for","trailing","zeros",".","For","example",",","if","axis","is","set","to","1","for","a","3-d","array","A",",","the","transformation","will","return","the","number","of","trailing","zeros","in","`","A","[","0",",",":",",","0","]","`",".","Parameters","--","--","--","--","--","new_field","Name","of","the","new","field","to","be","created",",","which","will","contain","the","number","of","trailing","zeros",".","target_field","Field","with","target","values","(","array",")","of","time","series","as_array","if","True",",","the","returned","field","will","be","a","numpy","array","of","shape","(","1",",",")"]
code: def __init__(
      self,
      new_field: str = "trailing_zeros",
      target_field: str = FieldName.TARGET,
      axis: int = -1,
      as_array: bool = False,
  ) -> None:
      self.target_field = target_field
      self.new_field = new_field
      self.axis = axis
      self.as_array = as_array
  
imports: from typing import List, Optional, Union, Type
  import numpy
  import pandas
  from gluonts.core.component import validated
  from gluonts.dataset.common import DataEntry
  from gluonts.dataset.field_names import FieldName
  from gluonts.time_feature import TimeFeature
  from ._base import MapTransformation, SimpleTransformation
label_desc: Use image node_id 1 to create a new CountTrailingZeros object from inherited base classes: SimpleTransformation with example: obj = CountTrailingZeros(new_field, target_field, axis, as_array)