Convert a list of dictionaries to hugging face dataset object

I have a list of dictionaries. for example
data =[{'col1:‘foo1’,col2’:‘bar1’}, {‘col1:'foo2',col2':'bar2'},...,{'col1:‘foon’,col2’:‘barn’}]’
how can I convert this array into a huggingface dataset object?

I think the easiest way would be datasets.Dataset.from_pandas(pd.DataFrame(data=data)).

1 Like

Thank you very much @beneyal ! It worked! :smiley: :heart_eyes:

1 Like