Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Create pie chart from DF

$
0
0

I have a dataframe that looks like this:

    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:

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

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

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles