-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
It is always complicated to load data from CSV files. I need much code for reading CSV.
Describe the solution you'd like
I'd like to use a loader directly in the Stream.of(...) method.
Additional context
Currently:
data = []
with open('data.csv', 'r') as f:
# Skip header
next(f)
for line in f:
attr1, attr2 = line.split(',')
data.append(Obj(attr1, attr2))
Stream.of(data)\
...Solution:
Stream.of(csv("data.csv")\
...The signature of the CSV loader could look like that:
def csv(file_path, delimiter=',')Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request