Relationships between variables

When we want to visualize the relationship between variables, we often begin with scatter plots, which show us the value of the y variable at different values of the x variable. This makes it very easy to spot correlations and possible non-linear relationships. In the previous chapter, when we looked at the Facebook stock data, we saw that the days of large volume traded appeared to be correlated with large drops in stock price. We can use a scatter plot to visualize this relationship:

>>> fb.assign(...     max_abs_change=fb.high - fb.low... ).plot(...     kind='scatter', x='volume', y='max_abs_change',...     title='Facebook Daily High - Low vs. Volume Traded'... )

There seems to be a relationship, but it does not seem ...

Get Hands-On Data Analysis with Pandas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.