'What is the role of next() function in sunspot dataset

I am currently making a course regarding to time series and sunspot data set is used in this course. I wonder what is the role of the next() function in the below code when I ignore it code line 'sunspots.append(float(row[2]))' gives error; ''' import csv time_step = [] sunspots = []

with open('./Sunspots.csv') as csvfile:
  reader = csv.reader(csvfile, delimiter=',')
  print(reader)
  next(reader)
  for row in reader:
    print(row)
    sunspots.append(float(row[2]))
    time_step.append(int(row[0]))

series = np.array(sunspots)
time = np.array(time_step)
plt.figure(figsize=(10, 6))
plot_series(time, series) '''

Thank you in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source