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
def__load_csv(file_path, cast, delimiter, encoding):
"""Load a CSV file and convert it into a list of namedtuples"""# skipcq: PTC-W6004withopen(file_path, mode='r', newline='', encoding=encoding) ascsvfile:
csvreader=reader(csvfile, delimiter=delimiter)
# Create a namedtuple type, casting the header values to int or float if possibleheader=__get_csv_header(csvreader)
Row=namedtuple('Row', list(header))
mapper=LoaderUtils.try_castifcastelselambdax: x# Process the data, casting values to int or float if possibledata= [Row(*[mapper(value) forvalueinrow]) forrowincsvreader]
returndata
what happens if the file is too big to fit in memory?...
From
__csv_loader.py
:what happens if the file is too big to fit in memory?...
Originally posted by @adrian-herscu in #94 (comment)
The text was updated successfully, but these errors were encountered: