Rate this Page
★ ★ ★ ★ ★

TensorDictBase.to_csv#

TensorDictBase.to_csv(path, *, separator: str | None = None, **kwargs)#

Writes this TensorDict to a CSV file.

Requires pandas to be installed.

Parameters:

path (str or Path) – Path to the output CSV file.

Keyword Arguments:
  • separator (str, optional) – If provided, nested keys are joined with this separator. Defaults to None.

  • **kwargs – Additional keyword arguments forwarded to pandas.DataFrame.to_csv.

Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.