@cvp Thanks for your reply. Can I ask you another question? I hope I'm not asking too much. If this is the case, please forgive me asking.
It regards the code below:
```
import csv
kolom = 'geb_dag'
value = 19
with open('data.csv', 'a', newline='') as csvfile:
fieldnames = ['column', 'value']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'column': kolom, 'value': value})```
This code gives an addition tot my data.csv file like:
column,value
geb_dag,19
I want to use this code several times to add more values to 'data.csv' like
column,value
geb_dag,19
geb_mnd, 10
geb_jr, 1981
vnaam, 2
anaam, 5
But every time I give the variables 'kolom' (which stands for columnname) and 'value' (which stand for values I want to add) other strings or integers I get:
column,value
geb_dag,19
column,value
geb_mnd, 10
column,value
geb_jr, 1981
column,value
vnaam, 2
column,value
anaam, 5
At first: I want to get rid of the "column, value" row every time I use the code.
Second: Even beter I want the CSV go to a horizontal presentation like:
geb_dag, geb_mnd, geb_jr, vnaam, a_naam,
19, 10, 1981, 2, 5
But what ever I do, it fails. Do you know an easy way to make this happen working with csv?
I have a code that is working. But this is written using pandas and that doesn't work in pythonista. For that reason I want to use CSV, so I can use my python code on my mobile.
Thank you so much
With kind regards.