Skip to main content
added 5 characters in body
Source Link
David Maddox
  • 2.2k
  • 3
  • 23
  • 36

Opening the file in binary mode "wb" will not work in Python 3+. Or rather, you'd have to convert your data to binary before writing it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', 'w', newline='') as outfile:

Opening the file in binary mode "wb" will not work in Python 3+. Or rather, you'd have to convert your data to binary before writing it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', newline='') as outfile:

Opening the file in binary mode "wb" will not work in Python 3+. Or rather, you'd have to convert your data to binary before writing it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', 'w', newline='') as outfile:
added 29 characters in body
Source Link
David Maddox
  • 2.2k
  • 3
  • 23
  • 36

ThisOpening the file in binary mode "wb" will not work in Python 3+. Or rather, you'llyou'd have to convert your data to binary before insertingwriting it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', newline='') as outfile:

This will not work in Python 3+. Or rather, you'll have to convert your data to binary before inserting it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', newline='') as outfile:

Opening the file in binary mode "wb" will not work in Python 3+. Or rather, you'd have to convert your data to binary before writing it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', newline='') as outfile:
Source Link
David Maddox
  • 2.2k
  • 3
  • 23
  • 36

This will not work in Python 3+. Or rather, you'll have to convert your data to binary before inserting it. That's just a hassle.

Instead, you should keep it in text mode, but override the newline as empty. Like so:

with open('/pythonwork/thefile_subset11.csv', newline='') as outfile: