I was able to load the .arff file using the following commands. But I was not able to extract the data from the object and convert the object into a dataframe format. I need this to do apply machine learning algorithms on this dataframe.
Command:-
import arff
dataset = pd.DataFrame(arff.load(open('Training Dataset.arff')))
print(dataset)
Please help me to convert the data from here into a dataframe.
import numpy as np
import pandas as pd
from scipy.io.arff import loadarff
raw_data = loadarff('Training Dataset.arff')
df_data = pd.DataFrame(raw_data[0])
Try this. Hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With