title: How to plot histogram of string and float value of a csv file using Pandas
body: <p>I need to show the histogram of a specific attribute of a csv file. When I plot numeric values I have no problems, but when I use string values the program crashes.
  Now I'm using the iris dataset for testing, the program crashes when I select the 'species' column. The error is:</p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\Users\Enrico\PycharmProjects\PythonDataset\Plot_hist.py", line 31, 
    in &lt;lambda&gt; self.pushButton.clicked.connect(lambda: 
    self.plotHistogram(fileName))
  File "C:\Users\Enrico\PycharmProjects\PythonDataset\Plot_hist.py", line 50, 
    in plotHistogram data_file[attribute].plot(kind='hist')
  File "C:\Python36\lib\site-packages\pandas\plotting\_core.py", line 2741, in 
    __call__ **kwds)
  File "C:\Python36\lib\site-packages\pandas\plotting\_core.py", line 2002, in 
    plot_series **kwds)
  File "C:\Python36\lib\site-packages\pandas\plotting\_core.py", line 1804, in 
    _plot plot_obj.generate()
  File "C:\Python36\lib\site-packages\pandas\plotting\_core.py", line 258, in 
    generate self._compute_plot_data()
  File "C:\Python36\lib\site-packages\pandas\plotting\_core.py", line 373, in 
    _compute_plot_data 'plot'.format(numeric_data.__class__.__name__))
  TypeError: Empty 'DataFrame': no numeric data to plot
  </code></pre>
  
  <p>My code is this:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import pandas as pd
  
  def plotHistogram(self, file):
      attribute = str(self.comboBox.currentText())
      data_file = pd.read_csv(file)
      data_file[attribute].plot(kind='hist')
      plt.ylabel('Frequency')
      plt.xlabel(attribute)
      plt.title("File")
      plt.show()
  </code></pre>
  
  <p><code>attribute</code>is the column name, <code>file</code> is the csv file.</p>
  
  <p>Note:
  If I change <code>data_file[attribute].plot(kind='hist')</code> into <code>data_file[attribute].hist()</code>
  the program doesn't crash, but after a long time it plots a strange histogram.</p>
  
  <p>EDIT:
  I have to show the histogram of laboratory analysis values, from csv files that have 20 to 30 attributes and more than a thousand lines.
  I need to show the histogram of the values ​​of each attribute taken individually, but the values ​​can be numeric data or strings.
  On the x axis I have to have the scale of the values ​​from the minimum to the maximum and on that of the y the frequency, as in this example:<a href="https://drive.google.com/open?id=1gBrJILp7_ixfXg6ub4semkTqCjN2OmmE" rel="nofollow noreferrer">enter link description here</a></p>