# Dica 32 - Importando CSV com Dask

[![](/files/-MfuAP1e7W4erW9hf6Ic)](https://youtu.be/xQIIaUrxUzY)

<https://towardsdatascience.com/pandas-vs-dask-vs-datatable-a-performance-comparison-for-processing-csv-files-3b0e0e98215e>

```
python -m pip install "dask[dataframe]"
pip freeze | grep dask >> requirements.txt
```

No Notebook digite

```python
import dask.dataframe as dd

df = dd.read_csv('/tmp/products.csv')

df.head()

df.tail()

Product.objects.all().delete()

def save_data(data):
    '''
    Salva os dados no banco.
    '''
    aux = []
    for item in data:
        title = item.get('title')
        price = item.get('price')
        obj = Product(
            title=title,
            price=price,
        )
        aux.append(obj)

    Product.objects.bulk_create(aux)

data = []

for index, row in df.iterrows():
    _dict = dict(title=row.title, price=row.price)
    data.append(_dict)

save_data(data)

Product.objects.all().count()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.dicas-de-django.com.br/098-32-import-csv-dask.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
