Python: SyntaxError: keyword can't be an expression

后端 未结 5 2252
清酒与你
清酒与你 2020-12-01 20:28

In a Python script I call a function from rpy2, but I get this error:

#using an R module 
res = DirichletReg.ddirichlet(np.asarray(my_values),al         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 21:15

    Using the Elastic search DSL API, you may hit the same error with

    s = Search(using=client, index="my-index") \
        .query("match", category.keyword="Musician")
    

    You can solve it by doing:

    s = Search(using=client, index="my-index") \
        .query({"match": {"category.keyword":"Musician/Band"}})
    

提交回复
热议问题