Merge pull request #67 from muratonuryildirim/master

Issue No:57 .arff to .csv/.xlsx converter
This commit is contained in:
Advaita Saha 2022-10-02 23:31:16 +05:30 committed by GitHub
commit d4f12d5e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -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`

View File

@ -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)