I'm trying to convert a csv file into a dictionary for calculation purposes and print it in exactly the same order (e.g. a, b, c, d, etc.) as they were in the original csv file.

I just learnt and tried using **csv.DictReader(file)** but I realized every time I did a print, the sequence of the row, column keeps changing, or I would say it mess up randomly.

Any solution for this or is there any part I did wrong?

```
import csv

with open("breast_cancer_v1.csv", 'r') as file:
    csv_file = csv.DictReader(file)
    for row in csv_file:
        print(dict(row))

```

I had name my column header as "a, b, c ,d ,e ,f ,h, i, j, k, l, m" inside my csv but the print sequence mess up as below:

output

[![enter image description here](https://i.stack.imgur.com/v7Gi9.png)](https://i.stack.imgur.com/v7Gi9.png)

notice the dictionary keys are not in order and my rows are also facing the same problem if i have too many rows in the csv (e.g. 100+ rows)

My original csv data looks like this:

[![enter image description here](https://i.stack.imgur.com/X7RdE.png)](https://i.stack.imgur.com/X7RdE.png)