You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/10 20:38:11 UTC

[GitHub] [spark] bjornjorgensen edited a comment on pull request #35747: [SPARK-38441][PYTHON] Support string and bool `regex` in `Series.replace`

bjornjorgensen edited a comment on pull request #35747:
URL: https://github.com/apache/spark/pull/35747#issuecomment-1064479400


   Yes, I think it will be easier for users and others to understand what the function does if you change the regex to change `bait` as well as the regex to change `bat` and `bar`. After reading the PR, I was left with the question of why `bait` was also not changed.
   If you change the regex so that the result looks like this
   
   `
   >>> psser = ps.Series(['bat', 'foo', 'bait', 'abc', 'bar', 'zoo'])
   >>> psser.replace(to_replace=r'^ba.$', value='new', regex=True)
   0     new
   1     foo
   2     new
   3     abc
   4     new
   5     zoo
   `
   
   then I think it will be easier to understand.
   
   KISS - Keep It Simple, Stupid


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org