diff --git a/scripts/arff_converter/readme.md b/scripts/arff_converter/readme.md new file mode 100644 index 0000000..cf8b833 --- /dev/null +++ b/scripts/arff_converter/readme.md @@ -0,0 +1,9 @@ +# ARFF to .CSV and .XLSX +This simple script converts .arff files to .csv and .xlsx. + +## Usage + +* Dependency: +* scipy +* pandas +* Use `pip install pandas` and `python -m pip install scipy` diff --git a/scripts/arff_converter/script.py b/scripts/arff_converter/script.py new file mode 100644 index 0000000..1ed1703 --- /dev/null +++ b/scripts/arff_converter/script.py @@ -0,0 +1,14 @@ +from scipy.io.arff import loadarff +import pandas as pd + + +def arff_to_csv(data, out_file_name): + + df = pd.DataFrame(loadarff(data)[0]) + df.to_csv(out_file_name, index=False) + + +def arff_to_excel(data, out_file_name): + + df = pd.DataFrame(loadarff(data)[0]) + df.to_excel(out_file_name, index=False)