i have a color dataframe with 4 columns and an array of [3,]
index = ["color","R", "G", "B"] # index as csv file definition
colors_csv = read_csv(csv_path , names=index, header=None)
colors = [[159 147 134][252 252 252][ 75 81 75][229 195 184]] # sample RGB data
i want to get a new sub dataframe from colors_csv with all the occurrence of colors in R,G,B columns
by far using .loc property will return me a correct list but consist of concatenated item which i can't iterate through and acquire new dataframe
# query with array of colors
for i in range(len(colors)):
aaaa = ([colors_csv.loc[(colors_csv['R'] == colors[i][0]) &
(colors_csv['G'] == colors[i][1]) & (colors_csv['B'] == colors[i][2])]])
print(aaaa) # how to have all these aaaa thorough loop as one dataframe
and i guess there could be a one line magic code which can do the job :)
any help appreciated