class_docstr: A collection of data which can be pre-processed in parallel on Spark.
class_docstr_tok: ["A","collection","of","data","which","can","be","pre-processed","in","parallel","on","Spark","."]
docstr: Stack tuple of features and labels in each partition into an ndarray for
  Orca Estimator traning
  
  :return: SparkXShards.
docstr_tok: ["Stack","tuple","of","features","and","labels","in","each","partition","into","an","ndarray","for","Orca","Estimator","traning",":","return",":","SparkXShards","."]
code: def stack_feature_labels(self) -> "SparkXShards":
      """
      Stack tuple of features and labels in each partition into an ndarray for
      Orca Estimator traning
  
      :return: SparkXShards.
      """
      if self._get_class_name() != "builtins.tuple":
          invalidInputError(
              False,
              "Currently only support stack_feature_labels() on"
              " XShards of tuple of features and labels",
          )
  
      def per_partition(iterator):
          features = []
          labels = []
          for it in iterator:
              feature, label = it[0], it[1]
              features.append(feature)
              labels.append(label)
          out = {
              "x": np.array(features).astype(np.float32),
              "y": np.array(labels).astype(np.float32),
          }
          return [out]
  
      rdd = self.rdd.mapPartitions(lambda x: per_partition(x))
      return SparkXShards(rdd)
  
imports: from py4j.protocol import Py4JError
  from bigdl.orca.data.utils import *
  from bigdl.orca import OrcaContext
  from bigdl.dllib.utils.common import get_node_and_core_number, get_spark_sql_context, get_spark_context
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.log4Error import invalidInputError
  import numpy
  from typing import TYPE_CHECKING, Any
  from typing import Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 46 for calling the SparkXShards obj's underlying member method code with example usage: obj.stack_feature_labels() and returns: SparkXShards, list