You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a dbf file where default date is coming as '00000000'. Is there any way to convert all columns into string before changing the format. My current code is-
import simpledbf as sdbf
import pandas as pd
import sys
import os
path = "path\\of\\directory\\"
for file in os.listdir(path):
if file.endswith(".DBF"):
print(file)
dbf1 = sdbf.Dbf5(path+file)
df = dbf1.to_dataframe()
df.to_csv(path+file[:-4]+'.TXT', header='0', index=None, sep='|', mode='a');
With above code I am getting error as : "ValueError: year 0 is out of range"
I am looking for below solution:
Either convert data types for all columns into string before changing the format
OR
Replace the invalid date value to some default date like 01/01/1900.
@rnelsonchem any ideas how can I handle this issue.
The text was updated successfully, but these errors were encountered:
I have a dbf file where default date is coming as '00000000'. Is there any way to convert all columns into string before changing the format. My current code is-
With above code I am getting error as : "ValueError: year 0 is out of range"
I am looking for below solution:
OR
@rnelsonchem any ideas how can I handle this issue.
The text was updated successfully, but these errors were encountered: