我有一个包含 11 列的数据框,我想根据其中两列中的值创建一个新的 0,1 列。
我已经尝试使用 np.where 创建其他列,但它不适用于这一列。
train["location"] = np.where(3750901.5068 <= train["x"] <= 3770901.5068
and -19268905.6133 <= train['y'] <= -19208905.6133, 1, 0)
Run Code Online (Sandbox Code Playgroud)
我收到此错误:ValueError:系列的真值不明确。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()。