code: def __init__(
      self,
      data=None,
      index=None,
      columns=None,
      dtype=None,
      copy=False,
      chunk_size=None,
      gpu=None,
      sparse=None,
      num_partitions=None,
  ):
      need_repart = False
      if isinstance(data, TENSOR_TYPE):
          if chunk_size is not None:
              data = data.rechunk(chunk_size)
          df = dataframe_from_tensor(
              data, index=index, columns=columns, gpu=gpu, sparse=sparse
          )
          need_repart = num_partitions is not None
      elif isinstance(data, SERIES_TYPE):
          df = data.to_frame()
          need_repart = num_partitions is not None
      elif isinstance(data, DATAFRAME_TYPE):
          if not hasattr(data, "data"):
              # DataFrameData
              df = _Frame(data)
          else:
              df = data
          need_repart = num_partitions is not None
      elif isinstance(data, dict) and self._can_process_by_1d_tileables(
          data
      ):
          # data is a dict and some value is tensor
          df = dataframe_from_1d_tileables(
              data, index=index, columns=columns, gpu=gpu, sparse=sparse
          )
          need_repart = num_partitions is not None
      elif isinstance(data, list) and any(
          isinstance(v, ENTITY_TYPE) for v in data
      ):
          # stack data together
          data = stack(data)
          df = dataframe_from_tensor(
              data, index=index, columns=columns, gpu=gpu, sparse=sparse
          )
          need_repart = num_partitions is not None
      elif isinstance(index, (INDEX_TYPE, SERIES_TYPE)):
          if isinstance(data, dict):
              data = {
                  k: astensor(v, chunk_size=chunk_size)
                  for k, v in data.items()
              }
              df = dataframe_from_1d_tileables(
                  data,
                  index=index,
                  columns=columns,
                  gpu=gpu,
                  sparse=sparse,
              )
          else:
              if data is not None:
                  data = astensor(data, chunk_size=chunk_size)
              df = dataframe_from_tensor(
                  data,
                  index=index,
                  columns=columns,
                  gpu=gpu,
                  sparse=sparse,
              )
          need_repart = num_partitions is not None
      else:
          if is_cudf(data) or is_cupy(data):  # pragma: no cover
              pdf = cudf.DataFrame(
                  data, index=index, columns=columns, dtype=dtype
              )
              if copy:
                  pdf = pdf.copy()
          else:
              pdf = pd.DataFrame(
                  data,
                  index=index,
                  columns=columns,
                  dtype=dtype,
                  copy=copy,
              )
          if num_partitions is not None:
              chunk_size = ceildiv(len(pdf), num_partitions)
          df = from_pandas_df(
              pdf, chunk_size=chunk_size, gpu=gpu, sparse=sparse
          )
  
      if need_repart:
          df = df.rebalance(num_partitions=num_partitions)
      super().__init__(df.data)
  
imports: import pandas
  from pandas.core.dtypes.common import pandas_dtype
  from ..core import ENTITY_TYPE
  from ..serialization.serializables import SerializableMeta
  from ..tensor import tensor, stack
  from ..tensor.array_utils import is_cupy
  from ..tensor.core import TENSOR_TYPE
  from ..utils import ceildiv, lazy_import
  from .core import DATAFRAME_TYPE, SERIES_TYPE, INDEX_TYPE, DataFrame, Series, Index
  from .datasource.dataframe import from_pandas
  from .datasource.series import from_pandas
  from .datasource.index import from_pandas, from_tileable
  from .datasource.from_tensor import dataframe_from_tensor, series_from_tensor, dataframe_from_1d_tileables
  from .utils import is_index, is_cudf
label_desc: Use image node_id 1 to create a new DataFrame object from inherited base classes: _Frame with example: obj = DataFrame(data, index, columns, dtype, copy, chunk_size, gpu, sparse, num_partitions)