File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2754,14 +2754,18 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
2754
2754
*
2755
2755
*/
2756
2756
rename (
2757
- mapper : any ,
2757
+ mapper : {
2758
+ [ index : string | number ] : string | number
2759
+ } ,
2758
2760
options ?: {
2759
2761
axis ?: 0 | 1
2760
2762
inplace ?: boolean
2761
2763
}
2762
2764
) : DataFrame
2763
- rename (
2764
- mapper : any ,
2765
+ rename (
2766
+ mapper : {
2767
+ [ index : string | number ] : string | number
2768
+ } ,
2765
2769
options ?: {
2766
2770
axis ?: 0 | 1
2767
2771
inplace ?: boolean
@@ -2777,8 +2781,9 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
2777
2781
const colsAdded : string [ ] = [ ] ;
2778
2782
const newColumns = this . columns . map ( col => {
2779
2783
if ( mapper [ col ] !== undefined ) {
2780
- colsAdded . push ( mapper [ col ] ) ;
2781
- return mapper [ col ]
2784
+ const newCol = `${ mapper [ col ] } ` ;
2785
+ colsAdded . push ( newCol ) ;
2786
+ return newCol ;
2782
2787
} else {
2783
2788
return col
2784
2789
}
You can’t perform that action at this time.
0 commit comments