import torch
from torch.utils.data import Dataset,DataLoader,TensorDataset
import pandas as pd
import numpy as np
'''
读取数据
'''
data_address = 'xxx.xlsx'
# dataset = pd.read_excel(data_address)#读取excel
# filepath="C:\\Users\\forwhat\\Desktop\\甘肃庆阳中国石油\\幅频特性与分析(统计特征)\\001-DSA_222.csv"
# filepath="C:\\Users\\zhouy_000\\Desktop\\python_study\\20190417\\test.csv"
dataset = pd.read_csv('001-DSA_222.csv',encoding='utf-8')#ch00 -x ch02 -y ch04 -z
# dataset = pd.read_csv('XXXX.CSV',encoding='utf-8')#读取csv
dataset.head(20)
def selected_dataset(dataset):#选取需要的特征
# features = ['有功功率(W)','最高气温','最低气温','天气状况','is_sunday']
features = ['Ch 00','Ch 02','Ch 04']
selected_dataset = dataset[features]
return selected_dataset
selected_dataset = selected_dataset(dataset)
selected_dataset.head()
|