title: I am trying to use texblob translator to translate a .csv file into english but I am getting the following error
body: <p>Here is the code that is causing problems</p>
  <pre><code>import pandas as pd
  from textblob import TextBlob
  df = pd.read_csv('C:/Users/prana/Downloads/Sample tweet.csv') # path to csv file
  df['english'] = df['tweet'].str.encode('ascii', 'ignore').apply(lambda x:TextBlob(x.strip()).translate(to='en'))
  df.to_csv(&quot;C:/Users/prana/Downloads/test.csv&quot;) # your documents folder
  </code></pre>
  <p>and the error I get is</p>
  <pre><code>TypeError: cannot use a string pattern on a bytes-like object'
  </code></pre>
  <p>Does anyone have any idea of how to go forward?</p>