📜  def extract_title(input_df): - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:06.680000             🧑  作者: Mango

代码示例1
def get_title(name):
    if '.' in name:
        return name.split(',')[1].split('.')[0].strip()
    else:
        return 'Unknown'

ans=get_title('Braund, Mr. Owen Harris')
print (ans)