AttributeError: 'str' object has no attribute 'keys'
This error is because you are initialising a dictionary writer dict_writer = csv.DictWriter(f, fieldnames=fieldnames) but then you are passing a normal row containing only the values r=rows.values() -> for d in r: ->dict_writer.writerow(d), when the writer expects a dictionary including the keys. That is what the error means.

I don't know how your JSON looks but you can try something like this:

import json
import csv

data = '{"dateTimeValues": [1,3,4], "timeSeries": [0,0,0]}'
rows = json.loads(data)

r=zip(*rows.values())

fieldnames = ['dateTimeValues', 'timeSeries']
with open('c:/Users/jsz.P3-GROUP/Desktop/shit.csv', 'w') as f:
    dict_writer = csv.writer(f)
    dict_writer.writerow(fieldnames)
    for d in r:
        dict_writer.writerow(d)


This initialises a simple csv writer dict_writer = csv.writer(f)(not dictionary), then inputs the fieldnames as a normal row for the header dict_writer.writerow(fieldnames) and finally inserts only the values as in your example.

Note that for my json string I had to transpose the values first as in r=zip(*rows.values()).

Hope this helps.