How should I perform STD
operation when I'm working with Django?
SELECT STD(total_cost)
FROM purchase;
tnx
How should I perform STD
operation when I'm working with Django?
SELECT STD(total_cost)
FROM purchase;
tnx
If you are looking for the Standard Deviation the following should give you what you want:
from django.db.models.aggregates import StdDev
print(Purchase.objects.all().aggregate(StdDev('total_cost')))
See the Django documentation for more information on how aggregation works.