【发布时间】:2021-05-27 14:05:32
【问题描述】:
当我打印一个列表时,我有一个带有以下输出的列表:
['/dbfs/mnt/abc/date=20210225/fsp_store_abcxyz_lmn_', '/dbfs/mnt/abc/date=20210225/fsp_store_schu_lev_bsd_s_']
我们的要求是:
fsp_store_abcxyz_lmn_
fsp_store_schu_lev_bsd_s_
请您帮忙看看如何满足列表中的要求。
【问题讨论】:
-
[i.split('/')[-1] for i in lst]? -
@MykolaZotko 是的,它确实回答了我的问题,非常感谢,您能否帮助我,例如是否也可以拥有源代码以及他的输出,例如 Source Extract /dbfs/mnt/abc/date =20210225/fsp_store_abcxyz_lmn_fsp_store_schu_lev_bsd_s_提取fsp_store_abcxyz_lmn_fsp_store_schu_lev_bsd_s_
-
@MykolaZotko 我们能否以表格格式获取两个不同列中的源和提取输出
-
@batman_special 更新了my answer 以表格形式输出。
-
@MykolaZotko 你能建议像这样的要求需要做什么
标签: python