嗨,我的数据框看起来像-
Email ID Date
0 mmn@yahoo.co.in 20/07/20
1 bvcd@vsnl.comÊ 20/07/20
2 hdgs@ahjhjo.com 20/07/20
3 hdt@abc.net 20/07/20
4 a007@aaaaa.in 20/07/20
5 accounts@atries.co.inÊ 20/07/20
6 cs@aaaom.comÊ 20/07/20
7 okli@buuu.comÊ 20/07/20
8 mnbl@ben.comÊ 20/07/20
9 dsf@plkl.com 20/07/20
我希望我的最终数据框看起来像-
Email ID Date mail
0 mmn@yahoo.co.in 20/07/20 mmn@yahoo.co.in
1 bvcd@vsnl.comÊ 20/07/20 bvcd@vsnl.com
2 hdgs@ahjhjo.com 20/07/20 hdgs@ahjhjo.com
3 hdt@abc.net 20/07/20 hdt@abc.net
4 a007@aaaaa.in 20/07/20 a007@aaaaa.in
5 accounts@atries.co.inÊ 20/07/20 accounts@atries.co.in
6 cs@aaaom.comÊ 20/07/20 cs@aaaom.com
7 okli@buuu.comÊ 20/07/20 okli@buuu.com
8 mnbl@ben.comÊ 20/07/20 mnbl@ben.com
9 dsf@plkl.com 20/07/20 dsf@plkl.com
在我的数据框中引入了一个空格,但是当尝试执行rtrim或trim功能时,它不起作用。我的代码如下-
df['email'] = df["Email ID"].str.rstrip()