Black Lives Matter. Please consider donating to Black Girls Code today.

Plotly - Pandas frames to Plotly data tables - how to convert?

Hi guys,
I’m newb and am playing around with Plotly tables https://plot.ly/javascript/table/
I use Python/Pandas as backend and want to feed data to ReactJS frontend/Plotly.js

having a problem with formatting the data/ plotly table and I hope I can get some suggestions from the community

So basically, my csv/ Pandas dataframe is a standard one like this
InvoiceNo StockCode Description UnitPrice Country
536365 85123A WHITE HANGING HEART T-LIGHT HOLDER 6 UK
536365 71053 WHITE METAL LANTERN 7 US

If I convert the above DF using _tojson or _tolist, I’ll get the data below that won’t work with Plotly properly
[[536365,“85123A”,“WHITE HANGING HEART T-LIGHT HOLDER”,6,“UK”],[536365,“71053”,“WHITE METAL LANTERN”,7,"US]]

Therefore, I have to run another numpy.tranpose() to convert the data table to the below
[[536365, 536365], [‘85123A’, ‘71053’], [‘WHITE HANGING HEART T-LIGHT HOLDER’, ‘WHITE METAL LANTERN’], [6, 7], [‘UK’,‘US’]]

I’m wondering if there is a better way to do this (without having to run transpose for example)

Thank you