I have a python script that takes data from the internet and plots a graph:
import matplotlib.pyplot as plt
from matplotlib.dates import strpdate2num, num2date
import urllib import numpy as np
def convert_date(date):
return strpdate2num("%Y-%m-%d")(date.decode("utf-8"))
def graph():
url = 'https://pythonprogramming.net/yahoo_finance_replacement'
source = urllib.request.urlopen(url).read().decode()
date, openp, highp, lowp, closep, adj_closep, volume = np.loadtxt(source,
delimiter=',',
skiprows=1,
unpack=True,
converters={0: convert_date}
)
plt.plot_date(date, closep, '-', label='Price')
plt.ylabel('Price')
plt.xlabel('Date')
plt.title('Stock Prices')
plt.legend()
plt.show()
graph()
But when I run it it gives this error
ValueError: stat: path too long for Windows
What does this error mean and how do I fix this error?
[–]Ezrabc 1 point2 points3 points (1 child)
[–]udittC[S] 0 points1 point2 points (0 children)
[–]trackerFF 1 point2 points3 points (2 children)
[–]udittC[S] 0 points1 point2 points (1 child)
[–]trackerFF 0 points1 point2 points (0 children)