0

I am writing a code for creating a time series plot from google data. Following are the steps I am using:

  1. Read data from a link using pandas
  2. Create a time series plot using bokeh

Below is my code:

# Creating a time-series plot
 
# import bokeh and panas
from bokeh.plotting import figure
from bokeh.io import output_file, show
import pandas as pd
 
# read data from a link
Data_04 = pd.read_csv("https://www.google.com/finance/quote/ADBE:NASDAQ?startdate=Jan+01,+2009&enddate=Aug+2,+2012&output=csv", parse_dates = ["Date"])
 
# Create a file
output_file(r"C:\Users\hsr4ban\Learning_Python_Jupyter\Jupyter_PracticeNotebooks\05_BokehPlots\20220708_04_Bokeh_GoogleData.html")
 
# Create a figure
Fig_04 = figure(width = 500, Height = 500, x_axis_type = "datetime")
 
# Create a plot
Fig_04.line(Data_04["Date"], Data_04["Close"], color = "Orange", alpha = 0.5)
 
# Show plot
show(Fig_04)

However, I am getting the below error when I run the code:

enter image description hereenter image description hereenter image description here

Can anyone please help in resolving the error?

bigreddot
  • 33,642
  • 5
  • 69
  • 122
RanjanN
  • 21
  • 4
  • 1
    Please always post error messages or code as actual text, rather than images of text, so that the content is accessible to users of assistive browser tools. – bigreddot Jul 08 '22 at 15:00
  • Actually I tried posting actual error. But I was unable to post, as stackoverflow showed an error saying that the question contains lot of code, please add further explanation. So, I had to convert error into image and paste! – RanjanN Jul 09 '22 at 01:46
  • Does this answer your question? [What column should I assign to parse\_dates while working with google finance?](https://stackoverflow.com/questions/72054453/what-column-should-i-assign-to-parse-dates-while-working-with-google-finance) -- Somewhere in the www must be a tutorial, which isn't up to date. The code example is the same, but there is a new/different error message. – mosc9575 Jul 10 '22 at 16:02
  • No, I am actually trying to find a solution for the URLError, whereas the above thread suggests the solution for the ValueError. As suggested in the above thread, ValueError is due to the absence of a column named "Date". Maybe I am getting the URLError as Google did not respond to the query that I asked. – RanjanN Jul 11 '22 at 04:00

0 Answers0