Following sampledata is given:

```
data = [
    {
        "name": "Sampleproject 1",
        "tasks": [
            {
                "order": 1,
                "description": "Do something 1",
                "status": "Done",
                "active": False
            },
            {
                "order": 3,
                "description": "Do something 3",
                "status": "Open",
                "active": False
            },
            {
                "order": 2,
                "description": "Do something 2",
                "status": "Open",
                "active": True
            }
        ]
    },
    {
        "name": "Sampleproject 2",
        "tasks": [
            {
                "order": 1,
                "description": "Do something 1",
                "status": "Done",
                "active": False
            },
            {
                "order": 1,
                "description": "Do something 3",
                "status": "Open",
                "active": True
            },
            {
                "order": 1,
                "description": "Do something 2",
                "status": "Open",
                "active": True
            },
            {
                "order": 2,
                "description": "Do something 4",
                "status": "Open",
                "active": False
            }
        ]
    }
]

```

I need to normalize this data for writing it to CSV file.
A single row for each task in tasks works well with *.explode()*. After this I have one column *tasks* with the task object. Next step is to convert this task object in single columns with *.apply(pd.Series)* but this does not work. I still get the full object as one column.

I found many similar cases and tutorials for this issue but nothing worked on my sample data.
I´m pretty sure the solution is easy, but where is the mistake I don´t see?

My code so far:

```
import pandas as pd

df = pd.DataFrame(data)
df = df.explode("tasks")
df["tasks"].apply(pd.Series)
df.to_csv('testfile.csv', index=False)

```

The CSV content:

```
name,tasks
Sampleproject 1,"{'order': 1, 'description': 'Do something 1', 'status': 'Done', 'active': False}"
Sampleproject 1,"{'order': 3, 'description': 'Do something 3', 'status': 'Open', 'active': False}"
Sampleproject 1,"{'order': 2, 'description': 'Do something 2', 'status': 'Open', 'active': True}"
Sampleproject 2,"{'order': 1, 'description': 'Do something 1', 'status': 'Done', 'active': False}"
Sampleproject 2,"{'order': 1, 'description': 'Do something 3', 'status': 'Open', 'active': True}"
Sampleproject 2,"{'order': 1, 'description': 'Do something 2', 'status': 'Open', 'active': True}"
Sampleproject 2,"{'order': 2, 'description': 'Do something 4', 'status': 'Open', 'active': False}"

```

**EDIT:**

Required/Expected CSV output:

```
name,order,description,status,active
Sampleproject 1,1,'Do something 1','Done',False
Sampleproject 1,3,'Do something 3','Open',False
Sampleproject 1,2,'Do something 2','Open',True
Sampleproject 2,1,'Do something 1','Done',False
Sampleproject 2,1,'Do something 3','Open',True
Sampleproject 2,1,'Do something 2','Open',True
Sampleproject 2,2,'Do something 4','Open',False

```