如何在 google colab 中读取 .arff 文件?
How to read .arff file in google colab?
有谁知道如何在 Google Colab 中读取 .arff 文件?
import numpy as np
import pandas as pd
from scipy.io.arff import loadarff
raw_data = loadarff('/content/Chronic_Kidney_Disease/chronic_kidney_disease_full.arff')
df_data = pd.DataFrame(raw_data[0])
不起作用。
161 else:
162 raise ValueError("%s value not in %s" % (str(data_str),
--> 163 str(self.values)))
164
165 def __str__(self):
ValueError: yes value not in ('yes', 'no')
可以使用以下代码解决:
#Import the Libraries
from scipy.io import arff
import pandas as pd
#Load the data using "arff.loadarff" then convert it to dataframe
data = arff.loadarff('spambase.arff')
df = pd.DataFrame(data[0])
有谁知道如何在 Google Colab 中读取 .arff 文件?
import numpy as np
import pandas as pd
from scipy.io.arff import loadarff
raw_data = loadarff('/content/Chronic_Kidney_Disease/chronic_kidney_disease_full.arff')
df_data = pd.DataFrame(raw_data[0])
不起作用。
161 else:
162 raise ValueError("%s value not in %s" % (str(data_str),
--> 163 str(self.values)))
164
165 def __str__(self):
ValueError: yes value not in ('yes', 'no')
可以使用以下代码解决:
#Import the Libraries
from scipy.io import arff
import pandas as pd
#Load the data using "arff.loadarff" then convert it to dataframe
data = arff.loadarff('spambase.arff')
df = pd.DataFrame(data[0])