在python中执行if-then逻辑时出现TypeError问题

时间:2018-10-11 21:10:56

标签: python typeerror databricks

我正在使用如下的if-then逻辑。当日期列没有任何空值时,我想转换日期格式。

mask = df['date'].isnull()
df['a'] = df['date'].dt.strftime('%Y-%m-%d')
df.loc[(-mask), 'date'] = df['a']

它在我的Windows机器和ec2中的Linux环境中均可使用。但是当我尝试在Databricks笔记本中运行时,它显示TypeError。

enter image description here

enter image description here

我需要帮助来了解错误,尤其是当它在其他地方没有任何错误运行时

0 个答案:

没有答案