title: How to decode a numpy array of encoded literals/strings in Python3? AttributeError: 'numpy.ndarray' object has no attribute 'decode'
body: <p>In Python 3, I have the follow <code>NumPy</code> array of <code>strings</code>. </p>
  
  <p>Each <code>string</code> in the <code>NumPy</code> array is in the form <code>b'MD18EE</code> instead of <code>MD18EE</code>. </p>
  
  <p>For example:</p>
  
  <pre><code>import numpy as np
  print(array1)
  (b'first_element', b'element',...)
  </code></pre>
  
  <p>Normally, one would use <code>.decode('UTF-8')</code> to decode these elements. </p>
  
  <p>However, if I try:</p>
  
  <pre><code>array1 = array1.decode('UTF-8')
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'decode'
  </code></pre>
  
  <p>How do I decode these elements from a <code>NumPy</code> array? (That is, I don't want <code>b''</code>)</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Let's say I was dealing with a <code>Pandas</code> <code>DataFrame</code> with only certain columns that were encoded in this manner. For example:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame(...)
  
  df
          COL1          ....
  0   b'entry1'         ...
  1   b'entry2'
  2   b'entry3'
  3   b'entry4'
  4   b'entry5'
  5   b'entry6'
  </code></pre>