title: Error: unsupported operand type(s) for /: 'str' and 'long'
body: <p><strong><em>Kaggle Titanic using python 2.7</em></strong></p>
  
  <pre><code>import pandas as pd
  from pandas import Series,DataFrame
  
  titanic_df = pd.read_csv("train.csv")
  
  import numpy as np
  import seaborn as sns
  import matplotlib.pyplot as plt
  %matplotlib inline
  
  **sns.factorplot('Pclass',data=titanic_df,hue='Sex')**
  </code></pre>
  
  <p><strong>Getting Error Below</strong></p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-7-a5240a4b6a9f&gt; in &lt;module&gt;()
        1 # Let's first check gender
  ----&gt; 2 sns.factorplot('Sex',data=titanic_df)
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\categorical.pyc in factorplot(x, y, hue, data, row, col, col_wrap, estimator, ci, n_boot, units, order, hue_order, row_order, col_order, kind, size, aspect, orient, color, palette, legend, legend_out, sharex, sharey, margin_titles, facet_kws, **kwargs)
     3365 
     3366     # Draw the plot onto the facets
  -&gt; 3367     g.map_dataframe(plot_func, x, y, hue, **plot_kws)
     3368 
     3369     # Special case axis labels for a count type plot
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\axisgrid.pyc in map_dataframe(self, func, *args, **kwargs)
      791 
      792             # Draw the plot
  --&gt; 793             self._facet_plot(func, ax, args, kwargs)
      794 
      795         # Finalize the annotations and layout
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\axisgrid.pyc in _facet_plot(self, func, ax, plot_args, plot_kwargs)
      809 
      810         # Draw the plot
  --&gt; 811         func(*plot_args, **plot_kwargs)
      812 
      813         # Sort out the supporting information
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\categorical.pyc in pointplot(x, y, hue, data, order, hue_order, estimator, ci, n_boot, units, markers, linestyles, dodge, join, scale, orient, color, palette, ax, **kwargs)
     3009                             estimator, ci, n_boot, units,
     3010                             markers, linestyles, dodge, join, scale,
  -&gt; 3011                             orient, color, palette)
     3012 
     3013     if ax is None:
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\categorical.pyc in __init__(self, x, y, hue, data, order, hue_order, estimator, ci, n_boot, units, markers, linestyles, dodge, join, scale, orient, color, palette)
     1575                                  order, hue_order, units)
     1576         self.establish_colors(color, palette, 1)
  -&gt; 1577         self.estimate_statistic(estimator, ci, n_boot)
     1578 
     1579         # Override the default palette for single-color plots
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\seaborn-0.7.0-py2.7.egg\seaborn\categorical.pyc in estimate_statistic(self, estimator, ci, n_boot)
     1434                     statistic.append(np.nan)
     1435                 else:
  -&gt; 1436                     statistic.append(estimator(stat_data))
     1437 
     1438                 # Get a confidence interval for this estimate
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\numpy\core\fromnumeric.pyc in mean(a, axis, dtype, out, keepdims)
     2872 
     2873     return _methods._mean(a, axis=axis, dtype=dtype,
  -&gt; 2874                           out=out, keepdims=keepdims)
     2875 
     2876 
  
  C:\Users\bigminduser\Anaconda2\lib\site-packages\numpy\core\_methods.pyc in _mean(a, axis, dtype, out, keepdims)
       70         ret = ret.dtype.type(ret / rcount)
       71     else:
  ---&gt; 72         ret = ret / rcount
       73 
       74     return ret
  
  **TypeError: unsupported operand type(s) for /: 'str' and 'long'**
  </code></pre>