Hi,
I have written a small python code for creating an excel file with 2 columns.But,after running the code, My data in the CSV File appears to be like this:
nodeLabel VonmissesStress
1 650
1 550
My code is as following:
with open('C:\\Users\\harsha\\SetData.csv', 'w') as csvfile:
fieldnames = ['nodeLabel', 'VonmissesStress']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'nodeLabel': '1', 'VonmissesStress': 'StressData'})
writer.writerow({'nodeLabel': '1', 'VonmissesStress': 'StressData'})
Could someone explain,Why I am getting one extra empty row between two filled rows.I would be really glad,if you can modify my code,so that there are no extra rows in between two filled rows.
Thanks in Advance!
I have written a small python code for creating an excel file with 2 columns.But,after running the code, My data in the CSV File appears to be like this:
nodeLabel VonmissesStress
1 650
1 550
My code is as following:
with open('C:\\Users\\harsha\\SetData.csv', 'w') as csvfile:
fieldnames = ['nodeLabel', 'VonmissesStress']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'nodeLabel': '1', 'VonmissesStress': 'StressData'})
writer.writerow({'nodeLabel': '1', 'VonmissesStress': 'StressData'})
Could someone explain,Why I am getting one extra empty row between two filled rows.I would be really glad,if you can modify my code,so that there are no extra rows in between two filled rows.
Thanks in Advance!