我使用numpy导入csv数据没有问题,但是我的xlsx文件始终出现错误。如何将xlsx文件转换为csv或如何将xlsx文件导入x2变量?
from matplotlib import pyplot as pp
import numpy as np
#this creates a line graph comparing flight arrival time, arrival in queue, and processing time
x,y = np.loadtxt ('LAX_flights.csv',
unpack = True,
usecols = (1,2),
delimiter = ',')
print("Imported data set arrival time")
x2 = np.loadtext ('First_Persons_PT.xlsx',
unpack = True,
usecols=(0))
print ("Imported start of processing time")
#y2=
#print ("Imported final time when processed")
pp.plot(x,y, 'g', linewidth = 1)
#pp.plot(x2,y, 'y', linewidth = 1)
pp.grid(b=True, which = 'major', color='0', …Run Code Online (Sandbox Code Playgroud)