Matthias
05/12/2020, 7:12 PMZachary Hughes
05/12/2020, 7:17 PMMatthias
05/12/2020, 7:20 PMDavid Ojeda
05/12/2020, 7:30 PM<http://pandas.DataFrame.to|pandas.DataFrame.to>_dict
function for your transformation ?Jim Crist-Harif
05/12/2020, 7:32 PM<http://df.to|df.to>_dict(orient='records')
or <http://df.to|df.to>_records()
In [15]: @task
...: def create():
...: return pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}).to_records()
...:
...:
In [16]: @task
...: def transform(row):
...: return row.a + row.b
...:
In [17]: with Flow("test") as flow:
...: data = create()
...: res = transform.map(data)
...:
In [18]: flow.run()
Matthias
05/12/2020, 8:40 PM