Skip to content

Commit a54f618

Browse files
committed
[frame.js][s]: obtain groupby column dtype to fix #183
1 parent 2b388e3 commit a54f618

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

danfojs-node/src/core/frame.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,10 @@ export class DataFrame extends Ndframe {
11101110
let column_names = this.column_names;
11111111
let col_dict = {};
11121112
let key_column = null;
1113-
1113+
let col_index = col.map((val) => column_names.indexOf(val));
1114+
let col_dtype = this.dtypes.filter((val, index) => {
1115+
return col_index.includes(index);
1116+
});
11141117
if (col.length == 2) {
11151118
if (column_names.includes(col[0])) {
11161119
// eslint-disable-next-line no-unused-vars
@@ -1172,7 +1175,8 @@ export class DataFrame extends Ndframe {
11721175
col_dict,
11731176
key_column,
11741177
this.values,
1175-
column_names
1178+
column_names,
1179+
col_dtype
11761180
).group();
11771181

11781182
return groups;

0 commit comments

Comments
 (0)