Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After converting via the code, there is nothing in arff file format when I open it with text editor #1

Closed
j00n162 opened this issue Jan 30, 2020 · 4 comments

Comments

@j00n162
Copy link

j00n162 commented Jan 30, 2020

Hello,

Thank you for sharing the code you created.
Like I said in the subject, after I convert csv file to arff file via the code, there is nothing in arff file format when I open it with text editor.
I am wondering if it happens to me only. Would you please help me to solve the issue?

Thank you,
Joon

@SilGervasoni
Copy link

Hi!

Thanks a lot for sharing your work! that was really useful and easy to run, so great job!!!
This is really just to thank you, however, if you want to look it up, I've spotted a typo (no big deal, really; for the rest, presentation is be spot on):

check for comams or blanks and adds single quotes

***** commas *****

for j in range(0,totalCols):
for i in range(1,totalRows):
allData[i][j] = allData[i][j].lower()

Another little issue I found while trying to use your code is that the .arff created by it was using just the first column as attribute. I solved this by changing a single line of code, so maybe it was a personal issue, not found in other factspecies. I'll post what I've done so that you might look this up as well, shall you feel like it....

Assigns numeric or nominal to each cell

for j in range(1,totalRows):
for i in range(0,totalCols):

###[...]

for j in range(0,totalCols):
p = j
for i in range(0,(totalRows-1)):
dataTypeTemp.append(dataType[p])
p += totalCols
if "nominal" in dataTypeTemp:
finalDataType .append("nominal")

I just commented out p = j, and everything runs smoothly now...
I hope you have a great day, and keep up the good work!!! we all need it so much ;-)

@j00n162
Copy link
Author

j00n162 commented Jan 31, 2020

Thank you so much for your comment. I appreciate your help.
I have one extra question, if you don't mind. What should be changed for assigning only nominal to each cell, not numeric, in this code? The code author tried to assign numeric or nominal to each cell based on the type of data (letter or number). However, is it possible to assign nominal to each cell even the value is numeric data? For example, the position in the dataset is deemed as numeric, but I want to assign the position as a nominal value.

@SilGervasoni
Copy link

Hi, j00n162!!!
About the issue of the program returning a blank .arff file, I think there might be a couple of instances that might cause the problem. I'll try to review them as they come up to me, I hope this will be of some help...

  1. You are running the program, but you did not specify the directory where your #fileToRead and #fileToWrite are stored... try creating a variable storing those directories, and make sure the program is actually able to find the file's storing location in your system.

  2. You did not rename #fileToRead and #fileToWrite at all, and it remained
    fileToRead = "worldcup2014.csv"
    fileToWrite = "worldcup2014.arff"
    instead of
    fileToRead = your .csv file
    fileToWrite = your .arff file
    I know it's an off chance, but making banal mistakes can happen to the very best, so I'll put it out there...

  3. you might have accidentaly altered the indentation, in suche a way that this prevents the program from running smoothly... to check if this is the case, I suggest you copypaste anaavila's script and start from scratch...

  4. you inserted lines of code before or after anaavila's script, that somehow mingle with it... I have obviously no way to know this for sure, but yu might want to check it out...

this are the first couple of instances I could think of on the top of my mind, I hope I somehow nailed it, but remember there might be a good amount of reasons why the program does not run properly...
just know that it works for me, so there's no reason why it should not be made to work for you, if you attentively work on it, so don't give up!!!

About the other question, I'm honestly not sure... sorry... :-/ :-(

@j00n162
Copy link
Author

j00n162 commented Jan 31, 2020

Thank you so much! Your comment was really helpful. Thank you!

@j00n162 j00n162 closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants