# Create pystarburst dataframe from pandas dataframe

**URL:** <https://www.starburst.io/community/forum/t/create-pystarburst-dataframe-from-pandas-dataframe/568>\
**Category:** Trino\
**Tags:** python\
**Created:** [August 14, 2024, 5:59am UTC](https://www.starburst.io/community/forum/t/create-pystarburst-dataframe-from-pandas-dataframe/568 "2024-08-14T05:59:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sb\_user](https://www.starburst.io/community/forum/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@sb\_user](https://www.starburst.io/community/forum/u/sb_user)\
**Post date:** [August 14, 2024, 5:59am UTC](https://www.starburst.io/community/forum/t/create-pystarburst-dataframe-from-pandas-dataframe/568/1 "2024-08-14T05:59:14Z")

</div>

Hi,

I was going through the pystarburst API guide and trying out some data engineering stuffs. I have a specific use case to create a pystarburst dataframe from a pandas dataframe.

When I checked the CreateDataframe method it takes list and tuple only as input. I couldn’t find a way to create a pystarburst dataframe from a pandas dataframe.

Just wanted to understand if there is anyway you would suggest me to do this.

Appreciate any help. Thanks.

---

<div class="post-metadata">

**Author:** ![monimiller](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/monimiller/32/140_2.png) [@monimiller](https://www.starburst.io/community/forum/u/monimiller)\
**Post date:** [August 28, 2024, 10:37pm UTC](https://www.starburst.io/community/forum/t/create-pystarburst-dataframe-from-pandas-dataframe/568/2 "2024-08-28T22:37:57Z")

</div>

Hi there!

The below code should be able to help you convert between a pandas dataframe to a pystarburst dataframe.

```auto
df = pd.DataFrame(pydf.collect())
print(df)
list_of_dicts = df.to_dict(orient='records')
# print(list_of_dicts)
pydf2 = session.create_dataframe(list_of_dicts)
df2 = pd.DataFrame(pydf2.collect())
print(df2)

```
