Issue
Given String;- "\NA*(0.0001,0.,NA,0.99999983,0.02) \EVENT=_Schedule185 \WGT=_WEEKS"
Output = EVENT=_Schedule185
Solution
You can use string extract
df['col'].str.extract('(EVENT=_\S*) ')
Answered By - Kenan
August 04, 2022 jupyter-notebook, pandas, python No comments
Given String;- "\NA*(0.0001,0.,NA,0.99999983,0.02) \EVENT=_Schedule185 \WGT=_WEEKS"
Output = EVENT=_Schedule185
You can use string extract
df['col'].str.extract('(EVENT=_\S*) ')
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.