python – Error can’t convert type ‘str’ to numerator/denominator while calculating population standard deviation in pythin

I am trying to calculate the population standard deviation of my data frame in python. I am using the function statistics.pstdev(df) by importing statistics Library. I have exclude all the non float columns from my dataset and it contain only float data columns. But I am getting the following error while executing.


TypeError                                 Traceback (most recent call last)
<ipython-input-118-f8b494b6fd29> in <module>()
      1 import statistics
----> 2 statistics.pstdev(tot2)

5 frames
/usr/lib/python3.6/statistics.py in pstdev(data, mu)
    664 
    665     """
--> 666     var = pvariance(data, mu)
    667     try:
    668         return var.sqrt()

/usr/lib/python3.6/statistics.py in pvariance(data, mu)
    635     if n < 1:
    636         raise StatisticsError('pvariance requires at least one data point')
--> 637     T, ss = _ss(data, mu)
    638     return _convert(ss/n, T)
    639 

/usr/lib/python3.6/statistics.py in _ss(data, c)
    533     """
    534     if c is None:
--> 535         c = mean(data)
    536     T, total, count = _sum((x-c)**2 for x in data)
    537     # The following sum should mathematically equal zero, but due to rounding

/usr/lib/python3.6/statistics.py in mean(data)
    310     if n < 1:
    311         raise StatisticsError('mean requires at least one data point')
--> 312     T, total, count = _sum(data)
    313     assert count == n
    314     return _convert(total/n, T)

/usr/lib/python3.6/statistics.py in _sum(data, start)
    146     for typ, values in groupby(data, type):
    147         T = _coerce(T, typ)  # or raise TypeError
--> 148         for n,d in map(_exact_ratio, values):
    149             count += 1
    150             partials(d) = partials_get(d, 0) + n

/usr/lib/python3.6/statistics.py in _exact_ratio(x)
    228         return (x, None)
    229     msg = "can't convert type '{}' to numerator/denominator"
--> 230     raise TypeError(msg.format(type(x).__name__))
    231 
    232 

TypeError: can't convert type 'str' to numerator/denominator