且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python Pandas:如何在列中搜索字符串?

更新时间:2023-11-14 22:43:16

答案是这里.让df作为您的DataFrame.

The answer is here. Let df be your DataFrame.

df[df['col2'].str.contains('NL')]

这将选择所有包含"NL"的记录.

This will select all the records that contain 'NL'.