Quickly visualizing data using pandas
pandas is an all-purpose data manipulation library. Not only can you use it for data acquisition and manipulation as we saw in Chapter 1, Acquire Free Financial Market Data with Cutting-edge Python Libraries and Chapter 2, Analyze and Transform Financial Market Data with pandas, but you can use it for plotting too. pandas offers various “backends” that are used while plotting through a common method. In this recipe, you’ll learn how to use the default backend, Matplotlib, to quickly plot financial market data using a line plot, bar chart, histogram, and others.
How to do it…
You can use the Matplotlib plots through pandas by importing them.
- Import the libraries:
import matplotlib as plt import pandas as pd from openbb import obb from pandas.plotting import bootstrap_plot, scatter_matrix obb.user.preferences.output_type = "dataframe"
- Download stock price data:
df = obb.equity.price.historical...