- if you want to call a specific column of data, say, the gender column, I can just type
data[0::,4], remembering that "0::" means all (from start to end), and Python starts indices from 0 (not 1) - You should be aware that the csv reader works by default with strings, so you will need to convert to floats in order to do numerical calculations. For example, you can turn the Pclass variable into floats by using
data[0::,2].astype(np.float)
This blog is about my learnings in big data, product management and digital advertising.
Thursday, September 18, 2014
Python Notes
Labels:
Python
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment