有没有一种方法可以使用熊猫数据框中元素值的前几个字符来过滤数据?

时间:2019-12-07 12:35:46

标签: python pandas dataframe

在熊猫中是否有一个contains()或startswith()等效项?我想根据另一列的内容过滤一些数据,但只想考虑前几个字符。我一直在努力使用布尔索引器,我想要这样的东西:

<?php
if (mysqli_num_rows(mysqli_query($con, sqlselectquery)) > 0)
{
    echo "found";
}
else
{
    echo "not found";
}
?>

<!----comment ---for select query to know row matching the condition are fetched or not--->

索引器是正确的走法还是有更好的方法?

0 个答案:

没有答案
相关问题