File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ df_summarized["percent of world population"]=100*df_summarized["pop"]/df_summari
327327df_summarized["percent of world GDP"]=100*df_summarized["gdp"]/df_summarized["gdp"].sum()
328328
329329
330- df2 = df_summarized[["continent",
330+ df = df_summarized[["continent",
331331"percent of world population",
332332"percent of world GDP",
333333]]
@@ -338,12 +338,12 @@ df2 = df_summarized[["continent",
338338fig=go.Figure()
339339for category in df_summarized["continent"].values:
340340 fig.add_trace(go.Bar(
341- x=df2 .columns[1:],
341+ x=df .columns[1:],
342342 #we need to get a pandas series that contains just the values to graph;
343343 #we do so by selecting the right row, selecting the right columns
344344 #and then tranposing and using iloc to convert to a series
345345 #here, I assume that the bar element category variable is in column 0
346- y=list(df2 .loc[df2 ["continent"]==category][list(df2 .columns[1:])].transpose().iloc[:,0]),
346+ y=list(df .loc[df ["continent"]==category][list(df .columns[1:])].transpose().iloc[:,0]),
347347 name=str(category)
348348
349349
You can’t perform that action at this time.
0 commit comments