Mulin commited on
Commit
9221958
1 Parent(s): 64b9f55

Update sg-holiday.py

Browse files
Files changed (1) hide show
  1. sg-holiday.py +3 -5
sg-holiday.py CHANGED
@@ -51,11 +51,9 @@ class TimesOfHoliday(datasets.GeneratorBasedBuilder):
51
  ]
52
 
53
  def _generate_examples(self, path=None):
54
- """Yields examples."""
55
- with open(path, encoding="utf8") as csv_file:
56
- csv_reader = csv.reader(
57
- csv_file, quotechar='"', delimiter=",", skipinitialspace=True, quoting=csv.QUOTE_ALL
58
- )
59
  for id_, row in enumerate(csv_reader):
60
  Date, Day, Holiday = row
61
  yield id_, {
 
51
  ]
52
 
53
  def _generate_examples(self, path=None):
54
+ with open(filepath, encoding='utf-8') as f:
55
+ csv_reader = csv.reader(f, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True)
56
+ next(csv_reader)
 
 
57
  for id_, row in enumerate(csv_reader):
58
  Date, Day, Holiday = row
59
  yield id_, {