# Create pie chart from DF

**URL:** <https://community.plotly.com/t/create-pie-chart-from-df/44400>\
**Category:** Dash Python\
**Created:** [September 1, 2020, 4:28am UTC](https://community.plotly.com/t/create-pie-chart-from-df/44400 "2020-09-01T04:28:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![datakid23](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@datakid23](https://community.plotly.com/u/datakid23)\
**Post date:** [September 1, 2020, 4:28am UTC](https://community.plotly.com/t/create-pie-chart-from-df/44400/1 "2020-09-01T04:28:31Z")

</div>

I have a dataframe that looks like this:

```auto
    server used capacity free
0 hpcfs5 2030.55 3209.8 1179.25
1 hpcfs6 1682.28 3207.8 1525.52

```

I want to do an as simple as possible used/free pie chart for each row. I’m have something working but it seems so overwrought I figured I must have done something wrong:

```auto
>>> for server in vd['server']:
... data=[int(vd.loc[vd['server']==server]['free']), int(vd.loc[vd['server']==server]['used'])]
... data
... 
[1179, 2030]
[1525, 1682]

```

Isn’t there an easier way to extract that free/used data?
