import numpy as np
def main():
try:
date, price, open = np.loadtxt('CARG.csv', delimiter=',',
unpack=True, dtype='str')
x = 0
for eachDate in date:
saveLine = eachDate + ',' + price[x] + '\n'
saveFile = open('newCSV', 'a')
saveFile.write(saveLine)
saveFile.close()
x += 1
except Exception as e:
print(e)
main()
问问题
203 次