I would like to create line chart using Pygal. The output should have 3 lines - 1 line for each category against the year. I have this error message: "NameError: name 'x' is not defined"
import pygal as pg
import pandas as pd
import csv
import numpy
filename = 'data.csv'
with open(filename, 'r') as f:
reader = csv.reader(f)
#print(list(reader))
pg_bar = pg.Bar()
for row in reader:
x.append(int(row[0]))
y.append(int(row[1]))
pg_bar.render_to_file("simple.svg")
Sample of the data is shown as below.

Can someone advise where I have done wrongly?
It looks like you have not initialized your x and y variables. Try something like this: