I have a file "LMD.rh.arff" which I am trying to convert to .csv file using the following code-
import pandas as pd
import matplotlib.pyplot as plt
from scipy.io import arff
# Read in .arff file-
data = arff.loadarff("LMD.rh.arff")
But this last line of code gives me the error-
--------------------------------------------------------------------------- UnicodeEncodeError Traceback (most recent call last) in ----> 1 data = arff.loadarff("LMD.rp.arff")
~/.local/lib/python3.6/site-packages/scipy/io/arff/arffread.py in loadarff(f) 539 ofile = open(f, 'rt') 540 try: --> 541 return _loadarff(ofile) 542 finally: 543 if ofile is not f: # only close what we opened
~/.local/lib/python3.6/site-packages/scipy/io/arff/arffread.py in _loadarff(ofile) 627 a = generator(ofile) 628 # No error should happen here: it is a bug otherwise --> 629 data = np.fromiter(a, descr) 630 return data, meta 631
UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 4: ordinal not in range(128)
In [6]: data = arff.loadarff("LMD.rh.arff")
--------------------------------------------------------------------------- UnicodeEncodeError Traceback (most recent call last) in ----> 1 data = arff.loadarff("LMD.rh.arff")
~/.local/lib/python3.6/site-packages/scipy/io/arff/arffread.py in loadarff(f) 539 ofile = open(f, 'rt') 540 try: --> 541 return _loadarff(ofile) 542 finally: 543 if ofile is not f: # only close what we opened
~/.local/lib/python3.6/site-packages/scipy/io/arff/arffread.py in _loadarff(ofile) 627 a = generator(ofile) 628 # No error should happen here: it is a bug otherwise --> 629 data = np.fromiter(a, descr) 630 return data, meta 631
UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 4: ordinal not in range(128)
You can download the file arff_file
Any ideas as to what's going wrong?
Thanks!