title: Plot a histogram in pandas columns with a mapping function
body: <p>l have a <code>csv</code> file that l process with <code>pandas</code>. The column is called <code>manual_raw_value</code> l want to retrieve the unique chars in this column and make a <code>histogram</code>.</p>
  
  <p>to retrieve all the uniques values l did the following : </p>
  
  <pre><code> unique_values = set(df.manual_raw_value.apply(list).sum())
  
  {' ',
   '!',
   '"',
   '%',
   '&amp;',
   "'",
   '(',
   ')',
   '*',
   '+',
   ',',
   '-',
   '.',
   '/',
   '0',
   '1',
   '2',
   '3',
   '4',
   '5',
   '6',
   '7',
   '8',
   '9',
   ':',
   '=',
   '&gt;',
   '?',
   '@',
   '_',
   'a',
   'b',
   'c',
   'd',
   'e',
   'f',
   'g',
   'h',
   'i',
   'j',
   'k',
   'l',
   'm',
   'n',
   'o',
   'p',
   'q',
   'r',
   's',
   't',
   'u',
   'v',
   'w',
   'x',
   'y',
   'z'}
  </code></pre>
  
  <p>Here is the data</p>
  
  <pre><code> manual_raw_value
      6,35
      11,68
      VOTRE
      AVEL AR VRO
      2292
      questions.
      nb
      les
      937,99
      à
      et
      TTC
      1
      620
      Echéance
      vos
      ROB21
      Pièce
      AGRIAL
      désignation
      des
      taux
      13s
      2
      par
      le
      mois,
      32
      21/07/2016
      FR
      au
      0
      téléphonique
      BROYEUR
      et
      ST
      TVA
      de
      des
      ECHEANCIER
      à
      ne
      lieu
      481,67
      N°0016
      de
      ministère
      de
      20/11/2015
      Si
      vous
      59
      cas
      EUR
      3.19
      2
      contrôle
      assurances
      BAS
      et
      4423873
      renseignements
      6104219
      C9DECOMPTEDIVERS
      6635
      DE
      10825
  </code></pre>
  
  <p>Now, since l have the <code>unique values</code>  l want to make a histgram.
  Here is what l've tried </p>
  
  <pre><code>  import pandas as pd
      def find_group(val):
          unique_values = set(df.manual_raw_value.apply(list).sum())
          for unique in unique_values:
              # get the number of occurence of all the unique values
              # then make a histogram
  
  
  
      df = pd.read_csv('words.csv',sep=',')
      df = df.astype(str)
      df.manual_raw_value=df.manual_raw_value.str.lower()
      df.manual_raw_value.apply(find_group)
      df.manual_raw_value.apply(find_group).value_counts().plot(kind='bar')
  </code></pre>
  
  <p>The unique values are those returned by the function 
  <code>unique_values = set(df.manual_raw_value.apply(list).sum())</code> which are <code>{' ', '!', '"', '%', '&amp;', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', .....</code> and so on .
   Now look for instance at the two values of manual <code>row values : 6,35 11,68</code> then we can say <code>1 appears twice 6 twice ',' twice 3 one time 5 one time</code></p>
  
  <p><strong>Edit-1</strong>
  l tried this code to make a histogram of the numbre of occurence of <code>alpha cells</code>, <code>alpahnumeric</code> cells and <code>special char cells</code></p>
  
  <pre><code>def find_group(val):
      val = str(val)
      if val.isalpha():
          return 'Alpha'
      elif val.isalnum and any(c.isalpha() for c in val):
          return 'Alphanumeric'
      else:
          return 'Special'
  
  df.Column_values.apply(find_group)
  df.Column_values.apply(find_group).value_counts().plot(kind='bar')
  </code></pre>
  
  <p>Now l want to make a histogram at a character level : </p>
  
  <ul>
  <li><p>get  the unique characters in the column by looping through each cell. <strong>(It's done)</strong></p></li>
  <li><p>Count the number of occurrence of these characters in all the cells and make a histogram . <strong># l get stucked at it</strong>
  -Once </p></li>
  </ul>
  
  <p><strong>Edit-2</strong>
  Let's take a practical example. Let's say my column is called <code>Column_value</code></p>
  
  <pre><code> Column_value
      hello
      good
      morning
      how 
      are 
      you
  </code></pre>
  
  <p>1-at each row  l compute the number of occurrence of each character </p>
  
  <pre><code>hello :  h=1 l=2 o=1 e=1
  good :   g=1 o=2 d=1
  morning : m=1 o=1 r=1 n=2 g=1
  how: h=1 o=1 w=1 
  are : a=1 r=1 e=1
  you: y=1 o=1 u=1
  </code></pre>
  
  <p>2- make a sum to get the number of of occurrence of each character in all rows</p>
  
  <pre><code>h=1+1=2
  l=2
  o=2+1+1+1=5
  e=1+1=2
  g=1
  d=1
  </code></pre>
  
  <p>and so on
   now , make a histogram of 
  h=2 , l=2 , o=5, e=2, g=1, d=1</p>