0

Given an empty python datatable frame empty_dt = dt.Frame(names= list_features).
How can I add (append) one row at a time to it, (like in pandas dataframe in this question)

Thanks.

ibra
  • 1,164
  • 1
  • 11
  • 26

1 Answers1

0

You can create a new 1-row datatable for each row and then append it using rbind.

for row in datasource:
    r = dt.Frame(row, names=list_features)
    empty_dt.rbind(r)
James
  • 32,991
  • 4
  • 47
  • 70
  • Thank you for your help :) . I find the complete definition of rbind(*frames, force=False, bynames=True) here : https://datatable.readthedocs.io/en/latest/api/frame.html#datatable.Frame.rbind – ibra Aug 11 '20 at 11:42