title: IndexError: too many indices on Python
body: <p>Using PyDev with an eclipse environment for Python 2.7 on OSX. Trying to count the element in the array and sum up the elements in the array. Getting an error on the index. </p>
  
  <pre><code>import numpy as np
  import os
  import sys
  
  csv_file_object = fileName = os.path.join('train.csv')
  print('Directory separator on your platform ({}): {}'.format(sys.platform, os.sep))
  
  data=[]
  for row in csv_file_object:
      data.append(row)
  data = np.array(data)
  
  number_passengers = np.size(data[0::,0].astype(np.float))
  number_survived = np.sum(data[0::,0].astype(np.float))
  proportion_survivors = number_survived / number_passengers
  
  Traceback (most recent call last):
    File "/Users/scdavis6/Documents/Kaggle/Titanic1.py", line 14, in &lt;module&gt;
      number_passengers = np.size(data[0::,0].astype(np.float))
  IndexError: too many indices
  </code></pre>
  
  <p>Let me know if I can provide additional information. </p>
  
  <p>Thank you.</p>
  
  <hr>
  
  <p><strong>Update:</strong> 
  I made <a href="https://stackoverflow.com/a/21182098/1639625">the edits</a>, but got another error about the module not being callable:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/scdavis6/Documents/Kaggle/Titanic1.py", line 5, in &lt;module&gt;
      csv_file_object = fileName = os.path('train.csv')
  TypeError: 'module' object is not callable
  </code></pre>
  
  <hr>
  
  <p><strong>Update:</strong>
  I changed os.path('train.csv') to os.path.join('train.csv'), but got another error about not finding the .csv file. </p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/scdavis6/Documents/Kaggle/Titanic1.py", line 9, in &lt;module&gt;
      with open(fileName) as f:
  IOError: [Errno 2] No such file or directory: 'train.csv'
  </code></pre>
  
  <p>Here's the absolute path for the .csv file and the python scripts.</p>
  
  <pre><code>import os
  os.path.abspath("/Users/scdavis6/Desktop/train.csv")
  </code></pre>
  
  <p>'/Users/scdavis6/Desktop/train.csv'</p>
  
  <pre><code>import os
  os.path.abspath("/Users/scdavis6/Documents/Kaggle/Titanic1.py")
  </code></pre>
  
  <p>'/Users/scdavis6/Documents/Kaggle/Titanic1.py'</p>