title: How to avoid decoding to str: need a bytes-like object error in pandas?
body: <p>Here is my code :</p>
  
  <pre><code>data = pd.read_csv('asscsv2.csv', encoding = "ISO-8859-1", error_bad_lines=False);
  data_text = data[['content']]
  data_text['index'] = data_text.index
  documents = data_text
  </code></pre>
  
  <p>It looks like</p>
  
  <pre><code>print(documents[:2])
                                                content  index
   0  Pretty extensive background in Egyptology and ...      0
   1  Have you guys checked the back end of the Sphi...      1
  </code></pre>
  
  <p>And I define a preprocess function by using gensim </p>
  
  <pre><code>stemmer = PorterStemmer()
  def lemmatize_stemming(text):
      return stemmer.stem(WordNetLemmatizer().lemmatize(text, pos='v'))
  def preprocess(text):
      result = []
      for token in gensim.utils.simple_preprocess(text):
          if token not in gensim.parsing.preprocessing.STOPWORDS and len(token) &gt; 3:
              result.append(lemmatize_stemming(token))
      return result
  </code></pre>
  
  <p>And when I use this function:</p>
  
  <pre><code>processed_docs = documents['content'].map(preprocess)
  </code></pre>
  
  <p>It appears </p>
  
  <pre><code>TypeError: decoding to str: need a bytes-like object, float found
  </code></pre>
  
  <p>How to encode my csv file to byte-like object or how to avoid this kind of error?</p>