I have the following variables.
num1 = '1'
num2 = '2'
num3 = '3'
num4 = '4'
num5 = '5'
num6 = '6'
num7 = '7'
num8 = '8'
Using jupyter notebook, I want to write to csv with 4 values on the 1st row to the left and 4 values on the 2nd row to the left without header and index.
I am expecting to see this in csv. How should I do it?
In the documentation, there is this example:
df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
'mask': ['red', 'purple'],
'weapon': ['sai', 'bo staff']})
df.to_csv(index=False)
I am not sure how to modify this part
{'name': ['Raphael', 'Donatello'],
'mask': ['red', 'purple'],
'weapon': ['sai', 'bo staff']}
to fit mine.
question from:
https://stackoverflow.com/questions/65858447/python-pandas-how-to-write-to-csv-in-certain-cells-without-header 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…