docstr: Export rolling result in form of :
      1. a 3d numpy ndarray when is_predict=True or horizon=0
         and time_enc=False
      2. a 2-dim tuple of 3d numpy ndarray (x, y) when is_predict=False
         and horizon != 0 and time_enc=False
      3. a 4-dim tuple of 3d numpy ndarray (x, y, x_enc, y_enc) when
         time_enc=True
  
  :return: a 3d numpy ndarray when is_predict=True or horizon=0
           and time_enc=False.
           or a 2-dim tuple of 3d numpy ndarray (x, y) when is_predict=False
           and horizon != 0 and time_enc=False
           or a 4-dim tuple of 3d numpy ndarray (x, y, x_enc, y_enc)
           when time_enc=True.
           The ndarray is casted to float32.
docstr_tok: ["Export","rolling","result","in","form","of",":","1.","a","3d","numpy","ndarray","when","is_predict=True","or","horizon=0","and","time_enc=False","2.","a","2-dim","tuple","of","3d","numpy","ndarray","(","x",",","y",")","when","is_predict=False","and","horizon","!","=","0","and","time_enc=False","3.","a","4-dim","tuple","of","3d","numpy","ndarray","(","x",",","y",",","x_enc",",","y_enc",")","when","time_enc=True",":","return",":","a","3d","numpy","ndarray","when","is_predict=True","or","horizon=0","and","time_enc=False",".","or","a","2-dim","tuple","of","3d","numpy","ndarray","(","x",",","y",")","when","is_predict=False","and","horizon","!","=","0","and","time_enc=False","or","a","4-dim","tuple","of","3d","numpy","ndarray","(","x",",","y",",","x_enc",",","y_enc",")","when","time_enc=True",".","The","ndarray","is","casted","to","float32","."]
code: def to_numpy(self):
      """
      Export rolling result in form of :
          1. a 3d numpy ndarray when is_predict=True or horizon=0
             and time_enc=False
          2. a 2-dim tuple of 3d numpy ndarray (x, y) when is_predict=False
             and horizon != 0 and time_enc=False
          3. a 4-dim tuple of 3d numpy ndarray (x, y, x_enc, y_enc) when
             time_enc=True
  
      :return: a 3d numpy ndarray when is_predict=True or horizon=0
               and time_enc=False.
               or a 2-dim tuple of 3d numpy ndarray (x, y) when is_predict=False
               and horizon != 0 and time_enc=False
               or a 4-dim tuple of 3d numpy ndarray (x, y, x_enc, y_enc)
               when time_enc=True.
               The ndarray is casted to float32.
      """
      if not self.deploy_mode:
          from bigdl.nano.utils.common import invalidInputError
  
          if self.numpy_x is None:
              invalidInputError(
                  False,
                  "Please call 'roll' method "
                  "before transform a TSDataset to numpy ndarray!",
              )
      if self.numpy_y is None and self.numpy_x_timeenc is None:
          return self.numpy_x
      elif self.numpy_x_timeenc is None:
          return self.numpy_x, self.numpy_y
      else:
          return (
              self.numpy_x,
              self.numpy_y,
              self.numpy_x_timeenc,
              self.numpy_y_timeenc,
          )
  
imports: import pandas
  import numpy
  import functools
  import logging
  from bigdl.chronos.data.utils.feature import generate_dt_features, generate_global_features
  from bigdl.chronos.data.utils.impute import impute_timeseries_dataframe
  from bigdl.chronos.data.utils.deduplicate import deduplicate_timeseries_dataframe
  from bigdl.chronos.data.utils.roll import roll_timeseries_dataframe
  from bigdl.chronos.data.utils.time_feature import time_features, gen_time_enc_arr
  from bigdl.chronos.data.utils.scale import unscale_timeseries_numpy, scale_timeseries_numpy
  from bigdl.chronos.data.utils.resample import resample_timeseries_dataframe
  from bigdl.chronos.data.utils.split import split_timeseries_dataframe
  from bigdl.chronos.data.utils.cycle_detection import cycle_length_est
  from bigdl.chronos.data.utils.quality_inspection import quality_check_timeseries_dataframe, _abnormal_value_repair
  from bigdl.chronos.data.utils.utils import _to_list, _check_type, _check_col_within, _check_col_no_na, _check_is_aligned, _check_dt_is_sorted
label_desc: Use image node_id 15 for calling the TSDataset obj's underlying member method code with example usage: obj.to_numpy() and returns: self, self,  self, self,  self,  self,  self