Подскажите, пожалуйста, почему результаты отличаются, когда квантили рассчитываются в пандах (Python) и R?
Код панд:
print('p_new: {:>5} {:>5} {:>5}'.format(
round(self.pandas_data_frame['pending_new'].quantile(0.50), 2),
round(self.pandas_data_frame['pending_new'].quantile(0.95), 2),
round(self.pandas_data_frame['pending_new'].quantile(0.99), 2),
))
print('new: {:>5} {:>5} {:>5}'.format(
round(self.pandas_data_frame['new'].quantile(0.50), 2),
round(self.pandas_data_frame['new'].quantile(0.95), 2),
round(self.pandas_data_frame['new'].quantile(0.99), 2),
))
Результаты:
name | .50| .95| .99|
p_new: 2.0 12.0 20.0
new: 52.0 78.0 106.06
R код:
dd = read.csv(“stats.csv”)
quantile(dd$pending_new, c(.50, .95, .99))
quantile(dd$new, c(.50, .95, .99))
результаты:
> quantile(dd$pending_new, c(.50, .95, .99))
50% 95% 99%
2.0 13.1 34.0
> quantile(dd$new, c(.50, .95, .99))
50% 95% 99%
52.00 81.00 129.26