Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,406 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hello,
the if statement fails when there is no value in df_data_2
How can I correct this?
thanks
if (round(df_data_1.collect()[0][0], 3) == round(df_data_2.collect()[0][0], 3)):
you can modify the following
df_data_1_1 = df_data_1.collect()
df_data_2_2 = df_data_2.collect()
if df_data_1_1 and df_data_2_2:
if round(df_data_1_collected[0][0], 3) == round(df_data_2_collected[0][0], 3):
# code here
pass
else:
print("xxxxxxx")
else:
print("empty dataframe")