nfmcclure / tensorflow_cookbook

Code for Tensorflow Machine Learning Cookbook
https://www.packtpub.com/big-data-and-business-intelligence/tensorflow-machine-learning-cookbook-second-edition
MIT License
6.24k stars 2.41k forks source link

08_logistic_regression #88 reopen for python 3 coding #125

Closed davidabek1 closed 6 years ago

davidabek1 commented 6 years ago

03_Linear_Regression\08_Implementing_Logistic_Regression\08_logistic_regression.py and also in the ipython notebook, same issue.

using csv writer, python 3 requires adding ",newline='' ", in order not to get extra empty line within each line write.

line 40: with open(birth_weight_file, "w", newline='') as f:

without this update, you get an error after reading the file and trying to load it into the x_vals variable.

nfmcclure commented 6 years ago

This should be updated now, thanks!