USING LIKE inside pandas.query()

后端 未结 6 586
庸人自扰
庸人自扰 2020-12-13 18:22

I have been using Pandas for more than 3 months and I have an fair idea about the dataframes accessing and querying etc.

I have got an requirement wherein I wanted t

6条回答
  •  青春惊慌失措
    2020-12-13 18:39

    @volodymyr is right, but the thing he forgets is that you need to set engine='python' to expression to work.

    Example: >>> pd_df.query('column_name.str.contains("abc")', engine='python')

    Here is more information on default engine ('numexpr') and 'python' engine. Also, have in mind that 'python' is slower on big data.

提交回复
热议问题