Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Amusing to see "dos2unix" pop up in the middle of the article. Python and Pandas can handle newlines directly, one pattern is:

  with open("gametimes.csv", "r", newline="") as f:
      df = pd.read_csv(f)


The standard library `csv` used to expect files in binary mode in 2.x and it annoyed me to no end.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: