AnymailRequestsAPIError: Sending a message to xxx@yyy.com from noreply@abc.eu <noreply@abc.eu>
Mailgun API response 404 (NOT FOUND):
{
"message": "Domain not found: mailgun.abc.eu"
}
以上功能不正确,但包含了有助于解释我的问题的代码:
假设电影的评分大于3.5,我必须返回import numpy as np
def charging_funct(rating , duration):
lst = rating.values
for x in np.nditer(lst):
if x > 3.5: # x will contain only value
return duration * rating
charging = pandas_udf(charging_funct , returnType = DoubleType())
df_2.select(charging(col("Rating"),col("Duration"))).show()
,否则返回duration * rating
。
duration
中的pandas_udf
有可能吗?分别比较每行效率不高,因为熊猫会处理批处理数据。