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/11 00:03:17 UTC

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

xinrong-databricks edited a comment on pull request #35747:
URL: https://github.com/apache/spark/pull/35747#issuecomment-1064637020


   The result for the example you give should be 
   ```py
   >>> psser.replace(to_replace=r'^ba.$', value='new', regex=True)
   0     new
   1     foo
   2    bait  # bait is not replaced since it doesn't pattern match `'^ba.$'`
   3     abc
   4     new
   5     zoo
   dtype: object
   ```
   
   The existing example in the PR `psser.replace('ba', 'xx', regex=True)` is to show even `ba` partially match `bait`, the replacement `xx` is applied to the whole string `bait`, i.e. `bait` is replaced to `xx`.
   
   CC @bjornjorgensen 


-- 
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