'float' object has no attribute 'astype'
<p>I am trying to find median values in a column of the dataframe. The median value that I am getting is float but I need it in integer format. </p>

<pre><code>c_med = round(df['count'].median().astype(int))

c_med = round(df['count'].median()).astype(int)
</code></pre>

<p>Both the above types give me this error. If <code>astype(int)</code> is removed then the answer is correct. </p>

<p>Error </p>

<pre><code>Traceback (most recent call last):
  File "all_median.py", line 16, in &lt;module&gt;
    c_med = round(df['count'].median()).astype(int)
AttributeError: 'float' object has no attribute 'astype'
</code></pre>