daft.read_csv#

daft.read_csv(path: str, fs: Optional[fsspec.spec.AbstractFileSystem] = None, has_headers: bool = True, column_names: Optional[List[str]] = None, delimiter: str = ',') daft.dataframe.dataframe.DataFrame[source]#

Creates a DataFrame from CSV file(s)

Example

>>> df = daft.read_csv("/path/to/file.csv")
>>> df = daft.read_csv("/path/to/directory")
>>> df = daft.read_csv("/path/to/files-*.csv")
>>> df = daft.read_csv("s3://path/to/files-*.csv")
Parameters
  • path (str) – Path to CSV (allows for wildcards)

  • fs (fsspec.AbstractFileSystem) – fsspec FileSystem to use for reading data. By default, Daft will automatically construct a FileSystem instance internally.

  • has_headers (bool) – Whether the CSV has a header or not, defaults to True

  • column_names (Optional[List[str]]) – Custom column names to assign to the DataFrame, defaults to None

  • delimiter (Str) – Delimiter used in the CSV, defaults to “,”

Returns

parsed DataFrame

Return type

DataFrame