class_docstr: Apply iterative differences to a timeseries.
  
  The transformation works for univariate and multivariate timeseries. However,
  the multivariate case applies the same differencing to every series.
  
  Difference transformations are applied at the specified lags in the order provided.
  
  For example, given a timeseries with monthly periodicity, using lags=[1, 12]
  corresponds to applying a standard first difference to handle trend, and
  followed by a seasonal difference (at lag 12) to attempt to account for
  seasonal dependence.
  
  To provide a higher-order difference at the same lag list the lag multiple
  times. For example, lags=[1, 1] takes iterative first differences like may
  be needed for a series that is integrated of order 2.
  
  Parameters
  ----------
  lags : int or array-like, default = 1
      The lags used to difference the data.
      If a single `int` value is
  
  na_handling : str, optional, default = "fill_zero"
      How to handle the NaNs that appear at the start of the series from differencing
      Example: there are only 3 differences in a series of length 4,
          differencing [a, b, c, d] gives [?, b-a, c-b, d-c]
          so we need to determine what happens with the "?" (= unknown value)
      "drop_na" - unknown value(s) are dropped, the series is shortened
      "keep_na" - unknown value(s) is/are replaced by NaN
      "fill_zero" - unknown value(s) is/are replaced by zero
  
  memory : str, optional, default = "all"
      how much of previously seen X to remember, for exact reconstruction of inverse
      "all" : estimator remembers all X, inverse is correct for all indices seen
      "latest" : estimator only remembers latest X necessary for future reconstruction
          inverses at any time stamps after fit are correct, but not past time stamps
      "none" : estimator does not remember any X, inverse is direct cumsum
  
  Examples
  --------
  >>> from sktime.transformations.series.difference import Differencer
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> transformer = Differencer(lags=[1, 12])
  >>> y_transform = transformer.fit_transform(y)
class_docstr_tok: ["Apply","iterative","differences","to","a","timeseries",".","The","transformation","works","for","univariate","and","multivariate","timeseries",".","However",",","the","multivariate","case","applies","the","same","differencing","to","every","series",".","Difference","transformations","are","applied","at","the","specified","lags","in","the","order","provided",".","For","example",",","given","a","timeseries","with","monthly","periodicity",",","using","lags=","[","1",",","12","]","corresponds","to","applying","a","standard","first","difference","to","handle","trend",",","and","followed","by","a","seasonal","difference","(","at","lag","12",")","to","attempt","to","account","for","seasonal","dependence",".","To","provide","a","higher-order","difference","at","the","same","lag","list","the","lag","multiple","times",".","For","example",",","lags=","[","1",",","1","]","takes","iterative","first","differences","like","may","be","needed","for","a","series","that","is","integrated","of","order","2",".","Parameters","--","--","--","--","--","lags",":","int","or","array-like",",","default","=","1","The","lags","used","to","difference","the","data",".","If","a","single","`","int","`","value","is","na_handling",":","str",",","optional",",","default","=","``","fill_zero","''","How","to","handle","the","NaNs","that","appear","at","the","start","of","the","series","from","differencing","Example",":","there","are","only","3","differences","in","a","series","of","length","4",",","differencing","[","a",",","b",",","c",",","d","]","gives","[","?",",","b-a",",","c-b",",","d-c","]","so","we","need","to","determine","what","happens","with","the","``","?","''","(","=","unknown","value",")","``","drop_na","''","-","unknown","value","(","s",")","are","dropped",",","the","series","is","shortened","``","keep_na","''","-","unknown","value","(","s",")","is\/are","replaced","by","NaN","``","fill_zero","''","-","unknown","value","(","s",")","is\/are","replaced","by","zero","memory",":","str",",","optional",",","default","=","``","all","''","how","much","of","previously","seen","X","to","remember",",","for","exact","reconstruction","of","inverse","``","all","''",":","estimator","remembers","all","X",",","inverse","is","correct","for","all","indices","seen","``","latest","''",":","estimator","only","remembers","latest","X","necessary","for","future","reconstruction","inverses","at","any","time","stamps","after","fit","are","correct",",","but","not","past","time","stamps","``","none","''",":","estimator","does","not","remember","any","X",",","inverse","is","direct","cumsum","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.difference","import","Differencer",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","y","=","load_airline","(",")",">",">",">","transformer","=","Differencer","(","lags=","[","1",",","12","]",")",">",">",">","y_transform","=","transformer.fit_transform","(","y",")"]
code: def __init__(self, lags=1, na_handling="fill_zero", memory="all"):
      self.lags = lags
      self.na_handling = self._check_na_handling(na_handling)
      self.memory = memory
  
      self._X = None
      self._lags = _check_lags(self.lags)
      self._cumulative_lags = None
      super().__init__()
  
      # if the na_handling is "fill_zero" or "keep_na"
      #   then the returned indices are same to the passed indices
      if self.na_handling in ["fill_zero", "keep_na"]:
          self.set_tags(**{"transform-returns-same-time-index": True})
  
imports: from typing import Union
  import numpy
  import pandas
  from sklearn.utils import check_array
  from sktime.datatypes._utilities import get_cutoff, update_data
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import is_int
label_desc: Use image node_id 1 to create a new Differencer object from inherited base classes: BaseTransformer with example: obj = Differencer(lags, na_handling, memory)