我正在寻找Pyspark数据框架的等效替代品。具体来说,我想在Pyspark数据框架上执行以下操作。
# in pandas dataframe, I can do the following operation
# assuming df = pandas dataframe
index = df['column_A'] > 0.0
amount = sum(df.loc[index, 'column_B'] * df.loc[index, 'column_C'])
/ sum(df.loc[index, 'column_C'])
我想知道在pyspark DataFrame中,做这个操作的等效方法是什么?