Skip to content

Replacing a value with 0 with dataframe.replace throws an error #621

Description

@Ren-Logronio

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions