Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions arff_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def makeArff(filename,handle,opts):
dataOut= []
attributesOut=[]
relation = filename.split(".")[0]
outfile = open(handle,'w')
with open(filename) as data_file:
dataIn = json.load(data_file)
for entry in dataIn["data"]:
Expand All @@ -195,7 +194,7 @@ def makeArff(filename,handle,opts):
values.append(entry[value])
dataOut.append(values)
attributesOut.append(attributes)
arff.dump(outfile, dataOut, relation=relation, names=attributesOut[0])
arff.dump(handle, dataOut, relation=relation, names=attributesOut[0])

def show_schema(schema):
"""debug"""
Expand All @@ -209,4 +208,4 @@ def main():
for filename in file_args:
process(filename, opts)

main()
main()