title: generate a heatmap from a dataframe with python and seaborn
body: <p>I'm new to Python and fairly new to seaborn.</p>
  
  <p>I have a pandas dataframe named df which looks like:</p>
  
  <pre><code>TIMESTAMP ACT_TIME_AERATEUR_1_F1 ACT_TIME_AERATEUR_1_F2 ACT_TIME_AERATEUR_1_F3 ACT_TIME_AERATEUR_1_F4 ACT_TIME_AERATEUR_1_F5 ACT_TIME_AERATEUR_1_F6 
  2015-08-01 23:00:00 80 0 0 0 10 0
  2015-08-01 23:20:00 60 0 20 0 10 10
  2015-08-01 23:40:00 80 10 0 0 10 10
  2015-08-01 00:00:00 60 10 20 40 10 10
  
  
  df.info()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 38840 entries, 0 to 38839
  Data columns (total 7 columns):
  TIMESTAMP                 38840 non-null datetime64[ns]
  ACT_TIME_AERATEUR_1_F1    38696 non-null float64
  ACT_TIME_AERATEUR_1_F3    38697 non-null float64
  ACT_TIME_AERATEUR_1_F5    38695 non-null float64
  ACT_TIME_AERATEUR_1_F6    38695 non-null float64
  ACT_TIME_AERATEUR_1_F7    38693 non-null float64
  ACT_TIME_AERATEUR_1_F8    38696 non-null float64
  dtypes: datetime64[ns](1), float64(6)
  memory usage: 2.1 MB
  </code></pre>
  
  <p>I try to do a heatmap using this code :</p>
  
  <pre><code>data = sns.load_dataset("df")
  
  # Draw a heatmap with the numeric values in each cell
  sns.heatmap(data, annot=True, fmt="d", linewidths=.5)
  </code></pre>
  
  <p>But it does not work 
  Can you help me pelase to find the error?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit</strong> 
  First , 
  I load dataframe from csv file : </p>
  
  <pre><code>df1 = pd.read_csv('C:/Users/Demonstrator/Downloads/Listeequipement.csv',delimiter=';', parse_dates=[0], infer_datetime_format = True)
  </code></pre>
  
  <p>Then, I select only rows which date '2015-08-01 23:10:00' and  '2015-08-02 00:00:00'</p>
  
  <pre><code>    import seaborn as sns
      df1['TIMESTAMP']= pd.to_datetime(df1_no_missing['TIMESTAMP'], '%d-%m-%y %H:%M:%S')
      df1['date'] = df_no_missing['TIMESTAMP'].dt.date
      df1['time'] = df_no_missing['TIMESTAMP'].dt.time
      date_debut = pd.to_datetime('2015-08-01 23:10:00')
      date_fin = pd.to_datetime('2015-08-02 00:00:00')
      df1 = df1[(df1['TIMESTAMP'] &gt;= date_debut) &amp; (df1['TIMESTAMP'] &lt; date_fin)]
  
  Then, construct the heatmap :
  sns.heatmap(df1.iloc[:,2:],annot=True, fmt="d", linewidths=.5)
  </code></pre>
  
  <p>I get this error : </p>
  
  <blockquote>
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-363-a054889ebec3&gt; in &lt;module&gt;()
        7 df1 = df1[(df1['TIMESTAMP'] &gt;= date_debut) &amp; (df1['TIMESTAMP'] &lt; date_fin)]
        8 
  ----&gt; 9 sns.heatmap(df1.iloc[:,2:],annot=True, fmt="d", linewidths=.5)
  
  C:\Users\Demonstrator\Anaconda3\lib\site-packages\seaborn\matrix.py in
  </code></pre>
    
    <p>heatmap(data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws,
    linewidths, linecolor, cbar, cbar_kws, cbar_ax, square, ax,
    xticklabels, yticklabels, mask, **kwargs)
            483     plotter = _HeatMapper(data, vmin, vmax, cmap, center, robust, annot, fmt,
            484                           annot_kws, cbar, cbar_kws, xticklabels,
        --> 485                           yticklabels, mask)
            486 
            487     # Add the pcolormesh kwargs here</p>
  
  <pre><code>C:\Users\Demonstrator\Anaconda3\lib\site-packages\seaborn\matrix.py in
  </code></pre>
    
    <p><strong>init</strong>(self, data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, cbar, cbar_kws, xticklabels, yticklabels, mask)
            165         # Determine good default values for the colormapping
            166         self._determine_cmap_params(plot_data, vmin, vmax,
        --> 167                                     cmap, center, robust)
            168 
            169         # Sort out the annotations</p>
  
  <pre><code>C:\Users\Demonstrator\Anaconda3\lib\site-packages\seaborn\matrix.py in
  </code></pre>
    
    <p>_determine_cmap_params(self, plot_data, vmin, vmax, cmap, center, robust)
            202                                cmap, center, robust):
            203         """Use some heuristics to set good defaults for colorbar and range."""
        --> 204         calc_data = plot_data.data[~np.isnan(plot_data.data)]
            205         if vmin is None:
            206             vmin = np.percentile(calc_data, 2) if robust else calc_data.min()</p>
  
  <pre><code>TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types
  </code></pre>
    
    <p>according to the casting rule ''safe''</p>
  </blockquote>