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

Value Error: could not convert string to float #29

Open
Kevin5013HD opened this issue Mar 13, 2018 · 1 comment
Open

Value Error: could not convert string to float #29

Kevin5013HD opened this issue Mar 13, 2018 · 1 comment

Comments

@Kevin5013HD
Copy link

Hi, you have developed an excelent package for readinf .dbf but I have had many issues reading one of them. I want to keep just 2 columns of the .dbf but first I have to load it to then read for delete columns later but at this step, I got a Value Error of one of the registers of the .dbf which is part of the columns I want to delete.

In fact, first I got a Value Error with strange characters but ,modifying the function 'parseN' it was converted that strange character to 'nz'

Thanks for helping me in this issue, I hope get your answer.

@TinyHandsome
Copy link

I have my way to solve this problem. You can change the source code in field_parser.p.
At code line 170:
except ValueError:
if not data.strip():
return None

# next two line, I insert my code to solve the problem.
elif data.strip() == b'.':
return '.'

else:
return float(data.replace())

It's my first time to answer question, I'm so sorry my English is so poor, and I don't know how to indent code. I hope my answer can solve your problem. If you have any question, you can contact me.

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