This is some basic code that I use to write results into a single Excel file:
import numpy_financial as npf
Present =2000
period =20
rate =0.12
pmt =abs(npf.pmt(rate/12,period*12,Present))
print(pmt)
import csv
file =open("Result.xlsx",'w')
file = csv.writer(file)
file.writerow([pmt])
as a result - Outcome. When I change the xlsx extension to csv, it opens successfully. I am aware that there is a library called xlsxwriter, but I'm curious as to whether the csv module supports xlsx extensions. Do I have something missing?