Isolate instances of potential_matches where the row sum is above or equal to 3 by using the .sum() method. Extract the

动态 未结 0 97
小小草
小小草 LV1 2023年9月23日 23:40 发表
Here's the code to isolate potential matches with row sum >=3, get values of second column index of matches, subset restaurants_new based on non-duplicate values, and append non_dup to restaurants: # Isolate potential matches with row sum >=3 matches = potential_matches[matches.sum(axis=1) >= 3] # Get values of second column index of matches matching_indices = matches.index.get_level_values(1) # Subset restaurants_new based on non-duplicate values non_dup = restaurants_new[~restaurants_new.index.isin(matching_indices)] # Append non_dup to restaurants full_restaurants = restaurants.append(non_dup) print(full_restaurants)
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复