@@ -80,42 +80,41 @@ class FExpr_Mean : public FExpr_Func {
8080 ));
8181 case SType::BOOL:
8282 case SType::INT8:
83- return make<int8_t , double >(std::move (col), gby, is_grouped);
8483 case SType::INT16:
85- return make<int16_t , double >(std::move (col), gby, is_grouped);
86- case SType::INT32:
87- return make<int32_t , double >(std::move (col), gby, is_grouped);
84+ case SType::INT32:
8885 case SType::INT64:
89- return make<int64_t , double >(std::move (col), gby, is_grouped);
9086 case SType::FLOAT64:
91- return make<double , double >(std::move (col), gby, is_grouped);
87+ return make<double >(std::move (col), SType::FLOAT64 , gby, is_grouped);
9288 case SType::FLOAT32:
93- return make<float , float >(std::move (col), gby, is_grouped);
89+ return make<float >(std::move (col), SType::FLOAT32, gby, is_grouped);
90+
9491 case SType::DATE32: {
95- Column coli = make<double , double >(std::move (col), gby, is_grouped);
92+ Column coli = make<double >(std::move (col), SType::FLOAT64 , gby, is_grouped);
9693 coli.cast_inplace (SType::DATE32);
9794 return coli;
9895 }
9996 case SType::TIME64: {
100- Column coli = make<double , double >(std::move (col), gby, is_grouped);
97+ Column coli = make<double >(std::move (col), SType::FLOAT64 , gby, is_grouped);
10198 coli.cast_inplace (SType::TIME64);
10299 return coli;
103- }
100+ }
101+
104102 default :
105103 throw TypeError ()
106104 << " Invalid column of type `" << stype << " ` in " << repr ();
107105 }
108106 }
109107
110108
111- template <typename T_IN, typename T_OUT>
112- Column make (Column &&col, const Groupby& gby, bool is_grouped) const {
109+ template <typename T_IN>
110+ Column make (Column &&col, SType stype, const Groupby& gby, bool is_grouped) const {
111+ col.cast_inplace (stype);
113112 if (is_grouped) {
114- return Column (new Latent_ColumnImpl (new Mean_ColumnImpl<T_IN, T_OUT, true >(
113+ return Column (new Latent_ColumnImpl (new Mean_ColumnImpl<T_IN, true >(
115114 std::move (col), gby
116115 )));
117116 } else {
118- return Column (new Latent_ColumnImpl (new Mean_ColumnImpl<T_IN, T_OUT, false >(
117+ return Column (new Latent_ColumnImpl (new Mean_ColumnImpl<T_IN, false >(
119118 std::move (col), gby
120119 )));
121120 }
0 commit comments