pathwaycom / pathway

Python ETL framework for stream processing, real-time analytics, LLM pipelines, and RAG.
https://pathway.com
Other
2.84k stars 98 forks source link

I want to convert a dict inside list into table with key as column name #30

Closed abdul756 closed 3 months ago

abdul756 commented 3 months ago

What is your question or problem? Please describe. How to convert a dict inside list into table with key as column name

Describe what you would like to happen response = [ "key 1" : "abcc" "key 2": "efgh" ]

I want to convert response to table table = "key 1" | "key 2" "abcc" "efgh" Please help to achieve this

zxqfd555-pw commented 3 months ago

Hi @abdul756

To create such kinds of tables we have several functions in the pw.debug module. Please refer to the docs here.

In particular, you can use the table_from_pandas method which creates a table from Pandas object where you can form a table object as you need. In the adjacent docs, there are some usage examples for this method, for instance, here.

abdul756 commented 3 months ago

Thank you, If I am having any issue i will ask

abdul756 commented 3 months ago

Thank you its working