csv.mdx 916 B

12345678910111213141516171819
  1. ---
  2. title: '📊 CSV'
  3. ---
  4. To add any csv file, use the data_type as `csv`. `csv` allows remote urls and conventional file paths. Headers are included for each line, so if you have an `age` column, `18` will be added as `age: 18`. Eg:
  5. ```python
  6. from embedchain import App
  7. app = App()
  8. app.add('https://people.sc.fsu.edu/~jburkardt/data/csv/airtravel.csv', data_type="csv")
  9. # Or add using the local file path
  10. # app.add('/path/to/file.csv', data_type="csv")
  11. app.query("Summarize the air travel data")
  12. # Answer: The air travel data shows the number of flights for the months of July in the years 1958, 1959, and 1960. In July 1958, there were 491 flights, in July 1959 there were 548 flights, and in July 1960 there were 622 flights.
  13. ```
  14. Note: There is a size limit allowed for csv file beyond which it can throw error. This limit is set by the LLMs. Please consider chunking large csv files into smaller csv files.