daft.DataFrame.read_csv#

classmethod DataFrame.read_csv(path: str, has_headers: bool = True, column_names: list[str] | None = None, delimiter: str = ',') daft.dataframe.dataframe.DataFrame[source]#

Creates a DataFrame from CSV file(s)

Example

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

  • 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