You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replacing a value with 0 with dataframe.replace throws an error #621
DataFrame.prototype.replace = function (oldValue, newValue, options) {
var _this = this;
var _a = __assign({ inplace: false }, options), columns = _a.columns, inplace = _a.inplace;
if (!oldValue && typeof oldValue !== 'boolean') {
throw Error("Params Error: Must specify param 'oldValue' to replace");
}
if (!newValue && typeof newValue !== 'boolean') {
throw Error("Params Error: Must specify param 'newValue' to replace with");
} <--- this is true for newValue = 0..
I do not see why this is intentional given that the nature of the error is that I specify a newValue to replace an old value. And thats what I was intending to do, to replace values to 0.
Activity
Reaganak40 commentedon Apr 19, 2024
I encountered the same issue when replacing a value with NaN
this.df.replace('-', NaN)
ChancellorO commentedon Sep 6, 2024
Same here, would love an update on this issue.
Fixed Replacing a value with 0 with dataframe.replace throws an error
Fixed Replacing a value with 0 with dataframe.replace throws an error