I am running the following the following python codes: It has been working well until today
import pandas as pd
import dbfread
data = dbfread.DBF(data.DBF, load = True)
df = pd.DataFrame(data)
I got the error message below: Not sure what's wrong?
ValueError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\dbfread\field_parser.py in parseN(self, field, data)
157 try:
--> 158 return int(data)
159 except ValueError:
ValueError: invalid literal for int() with base 10: b'*********'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-9-d243d1e0719c> in <module>
----> 1 data = dbfread.DBF('LNMSTR.DBF', load = True)
2 df = pd.DataFrame(data)
~\Anaconda3\lib\site-packages\dbfread\dbf.py in __init__(self, filename, encoding, ignorecase, lowernames, parserclass, recfactory, load, raw, ignore_missing_memofile)
131
132 if load:
--> 133 self.load()
134
135 @property
~\Anaconda3\lib\site-packages\dbfread\dbf.py in load(self)
166 """
167 if not self.loaded:
--> 168 self._records = list(self._iter_records(b' '))
169 self._deleted = list(self._iter_records(b'*'))
170
~\Anaconda3\lib\site-packages\dbfread\dbf.py in _iter_records(self, record_type)
306 for field in self.fields]
307 else:
--> 308 items = [(field.name,
309 parse(field, read(field.length))) \
310 for field in self.fields]
~\Anaconda3\lib\site-packages\dbfread\dbf.py in <listcomp>(.0)
307 else:
308 items = [(field.name,
--> 309 parse(field, read(field.length))) \
310 for field in self.fields]
311
~\Anaconda3\lib\site-packages\dbfread\field_parser.py in parse(self, field, data)
73 raise ValueError('Unknown field type: {!r}'.format(field.type))
74 else:
---> 75 return func(field, data)
76
77 def parse0(self, field, data):
~\Anaconda3\lib\site-packages\dbfread\field_parser.py in parseN(self, field, data)
162 else:
163 # Account for , in numeric fields
--> 164 return float(data.replace(b',', b'.'))
165
166 def parseO(self, field, data):
ValueError: could not convert string to float: b'*********'
i would appreciate it if anyone can help me understand this and fix. Is it the problem from my DBF database or is it from my code?
update: I can run the same codes at home's computer without errors. But it couldn't go thru at work's computer. Do you think it might be something else unrelated to the database itself? It's weird.