I am trying to generate a schema from a csv file using TableSchame package.
JavaScript
x
8
1
def main():
2
cls = '/Users//Downloads/s3_03b8a5f1-eddc-4ac5-9d72-.csv'
3
with open(cls, "rb") as f:
4
df= csv.reader(f)
5
6
table= Table(df)
7
table.infer(limit=500, confidence=0.55)
8
Gives me “raise exceptions.SourceError(message) tabulator.exceptions.SourceError: Only callable returning an iterator is supported”
How do i get the Table to work with a csv file?
Advertisement
Answer
Table
can be used by directly passing the CSV file path, see the docs:
JavaScript
1
2
1
table= Table(cls)
2