code: def _dataframe_to_xshards(
      data, feature_cols, label_cols=None, accept_str_col=False
  ):
      from zoo.orca import OrcaContext
  
      schema = data.schema
      shard_size = OrcaContext._shard_size
      numpy_rdd = data.rdd.map(
          lambda row: convert_row_to_numpy(
              row, schema, feature_cols, label_cols, accept_str_col
          )
      )
      shard_rdd = numpy_rdd.mapPartitions(
          lambda x: arrays2dict(x, feature_cols, label_cols, shard_size)
      )
      return SparkXShards(shard_rdd)
  
file_path: analytics-zoo/pyzoo/zoo/orca/learn/utils.py
imports: from zoo.common.utils import get_file_list
  from zoo.orca.data import SparkXShards
  from zoo.orca.data.utils import get_size
  from zoo.util.utils import convert_row_to_numpy
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: _dataframe_to_xshards(data, feature_cols, label_cols, accept_str_col) and returns: SparkXShards