Skip to content

Instantly share code, notes, and snippets.

@ChicagoDev
Created August 1, 2023 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChicagoDev/2074050e94a87e2171572b3c6ae585e8 to your computer and use it in GitHub Desktop.
Save ChicagoDev/2074050e94a87e2171572b3c6ae585e8 to your computer and use it in GitHub Desktop.
# Reading a CSV and creating a chart
import pandas as pd
import matplotlib.pyplot as plt # Provides us functions to create the visuals
# EOD Pricing for 12 instruments
data = pd.read_csv('/content/tr_eikon_eod_data.csv', #File location
index_col=0, # First column treated as an index
parse_dates=True) # Indicies are Dates
plt.plot(data['AAPL.O'])
plt.ylabel('Price $')
plt.xlabel('Year')
plt.title('Apple Stock Price')
# Stle String Samples
plt.plot(y.cumsum(), 'b', lw=1.5) # Plots the data as the line in blue with line width of 1.5
plt.plot(y.cumsum(), 'ro') # See API for details of format strings: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment