Plotting data showing 2 sets of data

this is my code

‘’'begin
2 wind = CSV.File(WindGenFile) |> DataFrame

3 rename!(wind, :" REGION" => :Region, :“DATE & TIME” => :DateTime, :" ACTUAL WIND(MW)" => :ActualWind, :" FORECAST REGION(MW)" => :ForecastWind)
5
6 windVectors = map([wind]) do df
7 select!(df, Not([Region]))
8 map([:ForecastWind, :ActualWind]) do data
9 df[!,data] = map(df[!,data]) do d
10 d == “-” ? missing : typeof(d) == Int ? d : parse(Int,d)
11 end
12 end
end

windDates = wind[:,:DateTime] ;
16 windDates = [(s[1:end-6]) for s in windDates]
17 windDates = [replace (s, “January” => “1”, “February” => 2, “March” => 3,“April”
=> 4, “May”=> 5, “June” => 6, “July” => 7, “August”’ => 8, “September” => 9,
“October” => 10, “November => 11”, “December” => 12) for s in windDates]
18 WindDateFormat = Dates.DateFormat(“dd mm yyyy”)
19 windDates = [Dates.Date(s, WindDateFormat) for s in windDates]
20 StringwindDates = string.(windDates);
21
22 Monday1 = findfirst(x → x == “2023-10-30”, StringwindDates)
23 Monday2 = findfirst(x → x == “2023-11-06”, StringwindDates)
24 Monday3 = findfirst(x → x == “2023-11-13”, StringwindDates)
25 Monday4 = findfirst(x → x == “2023-11-20”, StringwindDates)
26 Monday5 = findfirst(x → x == “2023-11-27”, StringwindDates)
27 Index0fMondays = [Monday1, Monday2, Monday3, Monday4, Monday5]
28 Dates0fMondays = [StringwindDates[i] for i = [Index0fMondays]]
29 Dates0fMondays = DatesOfMondays [1]
30
31 windForecast = windVectors [1][1]
32 windActual = windVectors [1][2]
33 Forecast = windForecast
34 Actual = windActual
35
36 range = 1:length(windForecast)
end’‘’
I am getting a syntax error and I don’t know what it is. Before this code I have 2 other cell blocks, the first one is ‘’‘using CSV, DataFrames, CairoMakie, Dates’‘’ and the second one is WindGenFile and then the file location.

Start by putting each line (or code block) in its own Pluto cell to see which line is giving the syntax error.

Also, you have made the common mistake of using ''' rather than ``` when posting your code. That is why is does not look right in the post.

Code should look like this in a separate box.
1 Like