UserSpace.new_space_from_csv

UserSpace.new_space_from_csv(filepath, space=None, cells=None, param=None, space_params=None, cells_params=None, *args, **kwargs)

Create spaces from from a comma-separated values (csv) file.

This method internally calls Pandas read_csv function, and creates cells by passing the returned DataFrame object to new_space_from_pandas(). The filepath argument to this method is passed to to read_csv as filepath_or_buffer, and the user can pass other arguments to read_csv by supplying those arguments to this method as variable-length parameters, args and kargs.

Parameters
  • filepath (str, path object, or file-like object) – Path to the file.

  • space – Sequence of strings to set cells name. string is also accepted if read_csv returns a Series because of its squeeze parameter set to True.

  • cells – Sequence of strings to overwrite headers for cells names.

  • param – Sequence of strings to set parameter name(s). A single string can also be passed to set a single parameter name when frame has a single level index (i.e. not MultiIndex).

  • space_params – Sequence of strings or integers to specify space parameters by name or index.

  • cells_params – Sequence of strings or integers to specify cells parameters by name or index.

  • args – Any positional arguments to be passed to read_csv.

  • kwargs – Any keyword arguments to be passed to read_csv.

See also

new_cells_from_csv(): Create Cells from CSV.