Understanding Boeing Data Over Time
Daily values - Line Chart
import pandas as pd
import yfinance as yf
import kaleido
import plotly.express as px
import plotly.io as pio
# Download boeing data for 2024 and flatten the index
start = '2024-01-01'
end = '2024-12-31'
boeing = yf.download('BA', start=start, end=end, interval='1d')
boeing.reset_index(inplace=True)
boeing.columns = boeing.columns.to_flat_index()
boeing.columns = ['_'.join(col) for col in boeing.columns]
boeing.columns = ["Date", "Close", "High", "Low", "Open", "Volume"] # rename columns
# Create the visualization
fig = px.bar(boeing, x="Date", y="Close", color_discrete_sequence=["black"])
# Show the image
fig.show()
# Save the image
pio.write_image(fig, "boeing_daily_bar.png", engine="kaleido")
Daily values - Bar chart

Monthly values - Line Chart

Monthly - Bar chart

Last updated