Index in SFrame

User 1703 | 12/20/2015, 10:19:17 PM

Hi all, this is a basic question - but I am trying to link an original reference frame to the output of a record linkage model. The model uses the Index of the SFrame as a reference. How can I create a row that has the Index of the SFrame so I can merge/join it to the results?

In pandas I would just use ds['ref'] = ds.index

Comments

User 1592 | 12/21/2015, 8:05:28 AM

Hi In an SFrame, if you did not have a row number you can use addrownumber() to add a row number, see https://dato.com/products/create/docs/generated/graphlab.SFrame.addrownumber.html Once you do have a row number, you can use its field name, for the example above the matching default field name is ds['ref'] = ds['id'] I hope this answers you question.