title: Azure Text Sentiment
body: <p>Im trying to azure sentiment analysis api</p>
  <pre><code>from azure.core.credentials import AzureKeyCredential
  from azure.ai.textanalytics import TextAnalyticsClient
  
  credential = AzureKeyCredential(&quot;&lt;api_key&gt;&quot;)
  endpoint=&quot;https://&lt;region&gt;.api.cognitive.microsoft.com/&quot;
  
  text_analytics_client = TextAnalyticsClient(endpoint, credential)
  
  documents = [
      &quot;I did not like the restaurant. The food was too spicy.&quot;,
      &quot;The restaurant was decorated beautifully. The atmosphere was unlike any other restaurant I've been to.&quot;,
      &quot;The food was yummy. :)&quot;
  ]
  
  response = text_analytics_client.analyze_sentiment(documents, language=&quot;en&quot;)
  result = [doc for doc in response if not doc.is_error]
  
  for doc in result:
      print(&quot;Overall sentiment: {}&quot;.format(doc.sentiment))
      print(&quot;Scores: positive={}; neutral={}; negative={} \n&quot;.format(
          doc.confidence_scores.positive,
          doc.confidence_scores.neutral,
          doc.confidence_scores.negative,
      ))
  
  </code></pre>
  <p>This code works fine, but I want to read a df column, get the text sentiment and create a column to storage the text sentiment, do you know how can i do it? I have tried to pass <code>documents = df['column_name']</code> and <code>df[I]</code>, but I get error</p>