Loading .arff type files in python




I am currently working on a problem which involves a file which is in “.arff” format. So how can I load this file into my jupyter notebook as a pandas dataframe.

Here is the link to download the file.
yeast-train.arff.zip (521.9 KB)


Hey @shubham.jain, This worked for me -

from scipy.io import arff
import pandas as pd

data = arff.loadarff('yeast-train.arff')
df = pd.DataFrame(data[0])


.arff type files are used for weka. Luckily, Scipy has a module that can read .arff file and convert that to numpy array. From there we can convert it to a data frame.

Note You first need to extract the zip file.

Hope this helps.

Sanad :slight_smile:


Thanks @mohdsanadzakirizvi. :slight_smile: