Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Plotting a DataFrame

Give Feedback

This is the last lesson of the course and shows you how you can plot your final DataFrame using vincent.

Resources#

pshekhar2707 on March 5, 2020

good to learn about vincent visualisation pkg

Tomasz Zajac on March 12, 2020

He played four matches against DAL vs one against MIL. Please use what you have shown for averages and correct the plot.

Tomasz Zajac on March 12, 2020

I cut the DataFrame to columns I will need for the plot only

group_by_opp = data.groupby('Opp')[['FGA', 'FG']]

I divided FGA and FG sums by number of matches played

field_goals_per_team = group_by_opp.sum()/group_by_opp.count()

And finally I’ve got much more informative plot

stacked = vincent.StackedBar(field_goals_per_team)
stacked.legend(title='Field Goals')
stacked.scales['x'].padding = 0.1
stacked.display()

zbigniewsztobryn on April 26, 2020

Great tutorial - thanks!

sroux53 on May 14, 2020

Excellent!

khurram703 on June 26, 2020

I m trying to run the below code in idle and it is not showing me the graphs in idle. Is idle not compatible with vincent? What i have to do make it working?

vincent 0.4.4 is already installed in my pc

stacked = vincent.StackedBar(field_goal_per_team)
stacked.legend(title='Field Goals')
stacked.scales['x'].padding = 0.1
stacked.display()

Output in idle:

<IPython.core.display.HTML object>

sunflower761 on Sept. 5, 2020

Thank you for the informative lesson

Become a Member to join the conversation.