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

added fix for comma instead of dot in floating point numbers #261

Closed
wants to merge 1 commit into from
Closed

added fix for comma instead of dot in floating point numbers #261

wants to merge 1 commit into from

Conversation

georgid
Copy link

@georgid georgid commented Aug 10, 2017

When there is a timestamp stored in a text file with comma instead of dot for dividing the whole number from the mantissa (e.g. 1,23 instead of 1.23), load_delimited throws an error.

@craffel
Copy link
Owner

craffel commented Aug 10, 2017

Is this common e.g. in Europe? Is mir_eval Americentric? I would otherwise argue that load_delimited isn't meant to do any actual conversion of the values - they should be ready-to-go for int() or float() or whatever. In other words, I would say if this is a bug it's a bug with float(). You could also fix this by passing in an appropriate "converter" for the col in question, e.g. lambda val: float(val.replace(',', '.').

@georgid
Copy link
Author

georgid commented Aug 12, 2017

The "converter" fix with the converter is absolutely solving the issue. Otherwise, I dont think that ',' instead of '.' is Europe-related situation. It is very likely to appear when values are exported from excel or other postprocessing editors that use ','-s.

@georgid georgid closed this Aug 12, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants