title: Splitting strings in an array in python
body: <p>I have an array which consists of two columns and several rows. IN the first column there are strings which I want to split. These elements have the form (*.txt).For instance, "main.txt", I need to save the prefix only (main). However, the "split" function does not work on an array. Can you tell me how can I address this problem?
  I saw several posts similar to what I have asked, but I could not find my answer. Sorry for the inconveniences, in advance. I have just started using python.</p>
  
  <p>Below, is my code and the error: </p>
  
  <pre><code>arr = np.genfromtxt('file',dtype=(str))
  rest=arr.split(".")[0]AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-27-02be1ad07338&gt; in &lt;module&gt;()
  ----&gt; 1 rest=arr.split(".")[0]
  
  AttributeError: 'numpy.ndarray' object has no attribute 'split'
  </code></pre>