[英]Pandas DataFrame: Remove everything after a non-digit character
I have a question that is similar to this one: Pandas DataFrame: remove unwanted parts from strings in a column 我有一个与此问题类似的问题: Pandas DataFrame:从列中的字符串中删除不需要的部分
The difference is that I want to remove all characters after a non digit character appear, for example: 区别在于,我想在出现非数字字符后删除所有字符,例如:
time result
1 09:00 52m2 +6
2 10:00 62m2+balkon
3 11:00 57.+2 balkona
4 12:00 30 m2
5 13:00 46(43)
I need to trim this data to: 我需要将此数据修剪为:
time result
1 09:00 52
2 10:00 62
3 11:00 57
4 12:00 30
5 13:00 46
I tried solutions from this , this and many more similar questions, but I couldn't find this specific use case. 我从this , 这个问题以及更多类似的问题中尝试了解决方案,但是我找不到这个特定的用例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.