在 jupyter 中修改数据框
Modifying a dataFrame in jupyter
我想删除此数据(密码)中 : 之后的内容,只保留电子邮件
[电子邮件]https://i.stack.imgur.com/dX9RB.png
你会考虑申请。
我认为这样的解决方案:
def remove_pw(x): #define your custom function
y = x.split(":") #simple way to split on the colon
return y[0] #return only the first part which is the email
df = yourdata
new_df = df['email'].apply(remove_pw)
根据您的图片:(我假设显示的内容名为 df 并且是有效的 pandas 数据帧。)
new_df = df['kobastal@yahoo.com:raskolnik'].apply(remove_pw)
我想删除此数据(密码)中 : 之后的内容,只保留电子邮件
[电子邮件]https://i.stack.imgur.com/dX9RB.png
你会考虑申请。
我认为这样的解决方案:
def remove_pw(x): #define your custom function
y = x.split(":") #simple way to split on the colon
return y[0] #return only the first part which is the email
df = yourdata
new_df = df['email'].apply(remove_pw)
根据您的图片:(我假设显示的内容名为 df 并且是有效的 pandas 数据帧。)
new_df = df['kobastal@yahoo.com:raskolnik'].apply(remove_pw)