title: Data Analyzed by Python CSV
body: <p>I convert a csv into a list called a. I have a way to classify my data through a conditional. The problem is that it is not working. If there is any element called 'Stable' on all my <code>Cliente</code>, I put the conditional of <code>'Estable'</code> which is not what I need but for all Clients that do not have <code>'Estable'</code> as AAA and BBB I want you to put <code>'NoAnalyzed'</code> as I explain below the code.</p>
  
  <pre><code>import pandas as pd
  
  a = [['Cliente', 'Fecha', 'Variables', 'Dia Previo', 'Mayor/Menor', 'Dia a Analizar', 'Analisis'], 
  ['AAA', '27/12/2017', 'ECPM_medio', '0.41', 'Dentro del Margen', '0.35', 'Incremento'],
  ['BBB', '27/12/2017', 'ECPM_medio', '1.06', 'Dentro del Margen', '1.06', 'Alerta'],
  ['CCC', '27/12/2017', 'ECPM_medio', '1.06', 'Dentro del Margen', '1.06', 'Estable']]
  
  
  
  headers = a.pop(0)
  df = pd.DataFrame(a, columns = headers)
  df['Analisis']
  
  
  for elemento in df['Analisis']:
      if elemento == 'Estable':
          df['Status'] = 'Stable: The client''s performance was Stable'
      else:
          df['Status'] = 'NoAnalyzed'
  
  
  df1= df.groupby(['Cliente','Fecha', 'Status']).size()
  df1
  
  output:
  &gt;&gt;&gt;
  Cliente  Fecha       Status                                    
  AAA      27/12/2017  Stable: The clients performance was Stable    1
  BBB      27/12/2017  Stable: The clients performance was Stable    1
  CCC      27/12/2017  Stable: The clients performance was Stable    1
  
  I need:
  &gt;&gt;&gt;
  Cliente  Fecha       Status                                    
  AAA      27/12/2017  NoAnalyzed    1
  BBB      27/12/2017  NoAnalyzed    1
  CCC      27/12/2017  Stable: The clients performance was Stable    1
  </code></pre>