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 {
27542754 *
27552755 */
27562756 rename (
2757- mapper : any ,
2757+ mapper : {
2758+ [ index : string | number ] : string | number
2759+ } ,
27582760 options ?: {
27592761 axis ?: 0 | 1
27602762 inplace ?: boolean
27612763 }
27622764 ) : DataFrame
2763- rename (
2764- mapper : any ,
2765+ rename (
2766+ mapper : {
2767+ [ index : string | number ] : string | number
2768+ } ,
27652769 options ?: {
27662770 axis ?: 0 | 1
27672771 inplace ?: boolean
@@ -2777,8 +2781,9 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
27772781 const colsAdded : string [ ] = [ ] ;
27782782 const newColumns = this . columns . map ( col => {
27792783 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 ;
27822787 } else {
27832788 return col
27842789 }
You can’t perform that action at this time.
0 commit comments