Один подход, который представляет собой бит numpy
array наклонный -
import numpy as np
# Convert item and user columns to a 2-column array
item_user_arr = np.asarray(df[["item","user"]]).astype(int)
# Mask of matches across rows of samples and item_user_arr, with columns flipped
mask = (samples[:,None,1]==item_user_arr[:,0]) & (samples[:,None,0]==item_user_arr[:,1])
# Get indices of matches
_,C = np.where(mask)
# Use those indices to select data from f1,f2,f3 columns for final output array
out = np.asarray(df[["f1","f2","f3"]])[C,:]
Выход для данных входов -
In [536]: out
Out[536]:
array([[ 9., 4., 4.],
[ 17., 6., 5.],
[ 17., 6., 5.],
[ 16., 5., 5.]])
Иногда это может происходить, потому что NetBeans пытается получить доступ к Java по неверному пути. Итак, вы пытались переустановить Java и NetBeans? Сначала удалите их оба и попробуйте переустановить их.