I am passing a column called petrol['tax'] of a dataframe to a function using .apply which returns 1st quartile. I am trying to use the below code but it throws me this error 'float' object has no attribute 'quantile'.
def Quartile(petrol_attrib):
return petrol_attrib.quantile(.25)
petrol['tax'].apply(Quartile)
I need help to implement this.
qcut