Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

babennettdev
Copy link
Contributor

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).
  • Updated unit tests forSeries.replace().
  • Updated unit tests forDataFrame.replace().

renatocfrancisco reacted with rocket emoji
@risenWrisenW requested a review fromsteveoniMarch 17, 2023 11:29
@ghost
Copy link

ghost commentedJul 10, 2023
edited by ghost
Loading

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 ✌

Copy link
Member

@risenWrisenW left a comment
edited
Loading

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

renatocfrancisco reacted with rocket emoji
@risenWrisenW merged commitae20c91 intojavascriptdata:devApr 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@risenWrisenWrisenW approved these changes

@steveonisteveoniAwaiting requested review from steveoni

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@babennettdev@risenW

[8]ページ先頭

©2009-2025 Movatter.jp