import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import numpy as np df = pd.read_csv('train.csv') df=df.drop(['ID'],axis=1) nmp=df.to_numpy() feature=nmp[:,:-1] label=nmp[:,-1]#(210,240) feature=np.fft.fft(feature) feature=np.abs(feature)/240*2 ax1 = plt.subplot(2,1,1) for i in range(240): if label[i]==0: plt.plot(range(240),feature[i,:],color='red') if label[i]==1: plt.plot(range(240),feature[i,:],color='blue') plt.show() print(1)
标签:plt,df,feature,频域,240,np,import,时域 From: https://www.cnblogs.com/hahaah/p/16941139.html