Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dates on graph
#21
(May-22-2019, 09:16 PM)mcgrim Wrote: ValueError: invalid literal for int() with base 10: '\n'
That could be the end of the file, with a trailing newline. Maybe adding a check for whitespace-only lines will help? Something like:
for line in file:
    if line.strip():
        parts = line.split()
        orig_date.append(parts[0])
        orig_time.append(parts[1])
        movements.append((parts[5]))
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020