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: Select specific columns of each pandas dataframe in SparkXShards and
  return a new SparkXShards.
  
  :param cols: string or list string.
  :return: a new SparkXShards.
docstr_tok: ["Select","specific","columns","of","each","pandas","dataframe","in","SparkXShards","and","return","a","new","SparkXShards",".",":","param","cols",":","string","or","list","string",".",":","return",":","a","new","SparkXShards","."]
code: def select(self, cols: Union[str, List[str]]) -> "SparkXShards":
      """
      Select specific columns of each pandas dataframe in SparkXShards and
      return a new SparkXShards.
  
      :param cols: string or list string.
      :return: a new SparkXShards.
      """
      if self._get_class_name() != "pandas.core.frame.DataFrame":
          invalidInputError(
              False,
              "Currently only support select() on"
              " SparkXShards of Pandas DataFrame",
          )
  
      if isinstance(cols, str):
          cols = [cols]
      invalidInputError(
          isinstance(cols, list), "cols should be str or list"
      )
  
      columns = [c for c in self.rdd.first().columns]
      for c in cols:
          check_cols_exists(columns, c, "cols")
  
      return SparkXShards(self.rdd.map(lambda df: df[cols]))
  
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 41 for calling the SparkXShards obj's underlying member method code with example usage: obj.select(cols) and returns: SparkXShards