I have a 2D array of Numpy data read from a .csv file. Each row represents a data point with the final column containing a a ‘key’ which corresponds uniquely to ‘key’ in another Numpy array – the ‘lookup table’ as it were.
What is the best (most Numpythonic) way to match up the lines in the first table with the values in the second?
Some example data:
Build a dictionary from key to row number in the lookup table:
Then you can use the dictionary to match up lines. For instance, if you just want to join the tables: