class_docstr: Abstract base class for time series panel tasks, e.g., classifiers, regressors.
  
  The class contains boilerplate for checks and data conversions,
  which are common to multiple descendants, most importantly,
  BaseClassifier and BaseRegressor.
docstr: Convert X and y if necessary as a user convenience.
  
  Convert X to a 3D numpy array if already a 2D and convert y into an 1D numpy
  array if passed as a Series.
  
  Parameters
  ----------
  X : an object of a supported Panel mtype, or 2D numpy.ndarray
  y : np.ndarray or pd.Series
  
  Returns
  -------
  X: an object of a supported Panel mtype, numpy3D if X was a 2D numpy.ndarray
  y: np.ndarray
docstr_tok: ["Convert","X","and","y","if","necessary","as","a","user","convenience",".","Convert","X","to","a","3D","numpy","array","if","already","a","2D","and","convert","y","into","an","1D","numpy","array","if","passed","as","a","Series",".","Parameters","--","--","--","--","--","X",":","an","object","of","a","supported","Panel","mtype",",","or","2D","numpy.ndarray","y",":","np.ndarray","or","pd.Series","Returns","--","--","--","-","X",":","an","object","of","a","supported","Panel","mtype",",","numpy3D","if","X","was","a","2D","numpy.ndarray","y",":","np.ndarray"]
code: def _internal_convert(self, X, y=None):
      """Convert X and y if necessary as a user convenience.
  
      Convert X to a 3D numpy array if already a 2D and convert y into an 1D numpy
      array if passed as a Series.
  
      Parameters
      ----------
      X : an object of a supported Panel mtype, or 2D numpy.ndarray
      y : np.ndarray or pd.Series
  
      Returns
      -------
      X: an object of a supported Panel mtype, numpy3D if X was a 2D numpy.ndarray
      y: np.ndarray
      """
      if isinstance(X, np.ndarray):
          # Temporary fix to insist on 3D numpy. For univariate problems,
          # most panel estimators simply convert back to 2D. This squeezing should be
          # done here, but touches a lot of files, so will get this to work first.
          if X.ndim == 2:
              X = X.reshape(X.shape[0], 1, X.shape[1])
      if y is None:
          return X
      return X, y
  
file_path: sktime/sktime/base/_base_panel.py
imports: import numpy
  import pandas
  from sktime.base import BaseEstimator
  from sktime.datatypes import MTYPE_LIST_PANEL, MTYPE_LIST_TABLE, VectorizedDF, check_is_error_msg, check_is_scitype, convert
  from sktime.utils.warnings import warn
label_desc: Use image node_id 9 for calling the BasePanelMixin obj's underlying member method code with example usage: obj._internal_convert(X, y) and returns: X,  y, X