title: matplotlib error : loop of ufunc does not support argument 0 of type float which has no callable rint method
body: <p>This is my dataSeries :
  df =</p>
  <pre><code>        count
  17    83396.142857
  18    35970.000000
  19    54082.428571
  20    21759.714286
  21    16899.571429
  22    19870.571429
  23    32491.285714
  24    40425.285714
  25    30780.285714
  26    11923.428571
  27    13698.571429
  28    28028.000000
  29    52575.000000
  </code></pre>
  <p>First converted it to int to avoid any issues:</p>
  <pre><code>df['count'] = df['count'].astype(int)
  df.index = df.index.astype(int)
  </code></pre>
  <p>I am trying to plot the data using :</p>
  <pre class="lang-py prettyprint-override"><code>    _, ax = plt.subplots(1,2)
      df.plot.pie(ax = ax[1], y = df['count'])
      plt.show()
  </code></pre>
  <p>but it keeps throwing the exception error:</p>
  <pre><code>Type:
    TypeError
  Message:
    loop of ufunc does not support argument 0 of type float which has no callable rint method
  Stacktrace:
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py&quot;, line 61, in _draw
      self.figure.draw(renderer)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/artist.py&quot;, line 41, in draw_wrapper
      return draw(artist, renderer, *args, **kwargs)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/figure.py&quot;, line 1863, in draw
      mimage._draw_list_compositing_images(
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/image.py&quot;, line 131, in _draw_list_compositing_images
      a.draw(renderer)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/artist.py&quot;, line 41, in draw_wrapper
      return draw(artist, renderer, *args, **kwargs)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py&quot;, line 411, in wrapper
      return func(*inner_args, **inner_kwargs)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/axes/_base.py&quot;, line 2747, in draw
      mimage._draw_list_compositing_images(renderer, self, artists)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/image.py&quot;, line 131, in _draw_list_compositing_images
      a.draw(renderer)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/artist.py&quot;, line 41, in draw_wrapper
      return draw(artist, renderer, *args, **kwargs)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/axis.py&quot;, line 1164, in draw
      ticks_to_draw = self._update_ticks()
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/axis.py&quot;, line 1022, in _update_ticks
      major_labels = self.major.formatter.format_ticks(major_locs)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/ticker.py&quot;, line 249, in format_ticks
      self.set_locs(values)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/ticker.py&quot;, line 782, in set_locs
      self._set_format()
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/matplotlib/ticker.py&quot;, line 884, in _set_format
      if np.abs(locs - np.round(locs, decimals=sigfigs)).max() &lt; thresh:
    File &quot;&lt;__array_function__ internals&gt;&quot;, line 5, in round_
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/numpy/core/fromnumeric.py&quot;, line 3739, in round_
      return around(a, decimals=decimals, out=out)
    File &quot;&lt;__array_function__ internals&gt;&quot;, line 5, in around
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/numpy/core/fromnumeric.py&quot;, line 3314, in around
      return _wrapfunc(a, 'round', decimals=decimals, out=out)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/numpy/core/fromnumeric.py&quot;, line 66, in _wrapfunc
      return _wrapit(obj, method, *args, **kwds)
    File &quot;/Users/eyshikaagarwal/.virtualenvs/env-hss-ml/lib/python3.8/site-packages/numpy/core/fromnumeric.py&quot;, line 43, in _wrapit
      result = getattr(asarray(obj), method)(*args, **kwds)
  [0m
  </code></pre>
  <p>Any suggestions .. what is wrong here ?
  I already spent hours to understand and fix it but no luck yet.
  Any help would be great.</p>
  <p><strong>Update :</strong></p>
  <p>Thank you @ehsan for the answer it worked for the pie chart , but I still get the same error when i do simple line plot using:</p>
  <pre class="lang-py prettyprint-override"><code>plot_kwargs = {'xticks': df.index,
                 'grid': True,
                  'color': 'Red',
                 'title' : &quot;Average &quot;}
  
  df.plot(ylabel = 'Average No. of tracks ', **plot_kwargs)
  </code></pre>
  <p>Its the exact same error I am getting with this code and I dont understand why . i even used <code>y='count'</code> here too , just to see if anything changes but its the same error.
  Any insights will be helpful
  Thank You!</p>