Coder Social home page Coder Social logo

convert-csv-to-arff's Introduction

convert-csv-to-arff

Simple Python program that converts a comma separated value (CSV) files to Attribute-Relation File Format (ARFF). where 'converts' means that an arff file is created and populated with the csv data. The csv file is not deleted or modified.

What the program does: Reads a csv file, selects all its attributes and assigns its data type ("numeric" or "nominal"). Selects unique data values for each nominal attribute, and inserts a '0' on each empty cell.

This program was made to facilitate some csv data cleaning when I was trying to open a csv file with Weka. This program helps to clean the csv file by converting it to arff format when the csv file has some inconsistencies, such as having numeric and nominal values for the same attribute values, and when it has empty cells.

About the ARFF format and the Weka Software: ARFF file format is used with Weka, a machine learning software from the University of Waikato. Information about the ARFF file and Weka is on the University of Waikato website: https://www.cs.waikato.ac.nz/ml/weka/arff.html

How to use the program:

  • Need Python 3.6
  • On program lines 34, 35, and 36, add the information of the csv file name you want to convert to arff format, what name you want to give it once converted to arff, and what name you want to give to your relation.

You can play around with the .csv file I included, and see its outcome on the .arff file included as well.

Note: You can open the arff file with a text editor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.