Py list to dataset

How can we make a dataset from py lists?

saw this a few posts ago, copy pasted it from JordanCClark

This is some basic stuff tho, did you watch the tutorial videos? did you check the docs? xd

sampleHeaders = ['t_stamp', 'value']
sampleData = [['2021-07-01 13:42:28', 1],
              ['2021-07-01 13:43:23', 1],
              ['2021-07-01 13:43:28', 0],
              ['2021-07-01 13:43:29', 0],
              ['2021-07-01 13:43:30', 1],
              ['2021-07-01 13:43:32', 1],
              ['2021-07-01 13:43:36', 0],
              ['2021-07-01 13:43:39', 1],
              ['2021-07-01 13:43:41', 1],
              ['2021-07-01 13:43:45', 0]
sampleData = [[[0]), row[1]] for row in sampleData]

sampleDataSet = system.dataset.toDataSet(sampleHeaders, sampleData)

Thank you @JordanCClark
@victordcq Since you watched the videos, will you send me a link of the dataset video?

Thank you! Although the video is on how to manipulate datasets not making one from python lists but the doc link is great! Glad you can do a better search than me. xd

I suggest you learn how to search the docs / forum / google.
Its a valuable skill for every programmer. From debugging to finding code others already made that works!.

Thank you for your kind suggestion.

If you post an example of what lists you’re working with, we may be able to help better.

1 Like

Thank you, your example gave me an idea on how to approach my task.