mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-23 20:11:10 +00:00
create arff_converter script.py
This commit is contained in:
parent
587f551219
commit
9494208304
14
scripts/arff_converter/script.py
Normal file
14
scripts/arff_converter/script.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user