Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork217
559 replace does not accept falsy strings or numbers#562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
559 replace does not accept falsy strings or numbers#562
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…or when oldValue is NaN
…ers (0), falsy strings (''), and throw when oldValue is NaN.
ghost commentedJul 10, 2023 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
Hi, I've been checking a bit the pull request and it seems that there is a failure in the treatment of dates, this is the code that fails and what it expects, I don't know if it is due to the changes in the pull request or other changes. Code: test('DataFrame Dates',()=>{letdata=[['Alice',2,newDate('2029-01-01 01:00:00')],['Bob',5,newDate('2019-01-02')],['Charlie',30,newDate('2020-01-03 01:00:20')],['Dennis',89,newDate('2022-02-04 02:16:00')]]letcolumns=["Name","Count","Date"];letdf=newdfd.DataFrame(data,{columns:columns});expect(df["Date"].dt.hours().values).toStrictEqual([1,0,1,2]);}) Error: Error: expect(received).toStrictEqual(expected) // deep equality- Expected - 1+ Received + 1 Array [ 1,- 0,+ 1, 1, 2, ] Regards ✌ |
risenW left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice, thanks for the fix! Just need to look at why test is failing
Overview
Fix for Issue#559 .
Series.replace()
accepts 0 and '' for botholdValue
andnewValue
.Series.replace()
accepts NaN fornewValue
.Series.replace(
) throws ifoldValue
is NaN (notifies user thatSeries.fillNa()
should be used instead).DataFrame.replace()
accepts 0 and '' for botholdValue
andnewValue
.DataFrame.replace()
accepts NaN fornewValue
.DataFrame.replace(
) throws ifoldValue
is NaN (notifies user thatDataFrame.fillNa()
should be used instead).Series.replace()
.DataFrame.replace()
.