AttributeError:“DataFrame”对象没有属性“take”

问题描述 投票:0回答:1
# Preprocessing: Drop unnecessary columns and handle missing values
features = final_data.drop(['label'], axis=1)
labels = final_data['label']

# Split the dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(features, labels, test_size=0.3, random_state=42)

我正在尝试使用二分图构建一个 GCN 来进行攻击预测。我不确定我还需要做什么。谁能帮我解决这个错误?

python machine-learning graph deep-learning bipartite
1个回答
0
投票

很难知道您提供的示例,但它告诉您数据框不包含名为“take”的列

使用 .columns 检查命名是否正确

© www.soinside.com 2019 - 2024. All rights reserved.