Paramatrization table to Pandas dataframe

Hi all,

I was wondering how you can easily create a Pandas dataframe from a table in parametrization. I tried to use the following:

table = params.table
df = pd.read_json(table)

This however does not work. Does any of you know what to do?

Cheers!

Hi Jelle,

I’m glad you are asking this question, as this (I think), is something that a lot of developers encounter. As a VIKTOR table is simply a list of dictionaries, it should be as easy as simply doing the following:

import pandas as pd

table = params.table
df = pd.DataFrame(table)

Other approaches are also discussed in this StackOverflow link: python - Convert list of dictionaries to a pandas DataFrame - Stack Overflow

I hope this helps.