I'm trying to create a program that needs to search a csv file for matching values in another csv file.
Here is what I have so far:
import pandas as pd
import numpy as np
listings = pd.read_csv("data/listings.csv")
inventoryValue = pd.read_csv("data/inventoryValue.csv")
#get rid of rows with empty values in column 'Item Number'
listings['Item Number'].replace('', np.nan, inplace=True)
listings.dropna(subset=['Item Number'], inplace=True)
#get rid of rows with empty values in column 'AvgCost'
inventoryValue['Avg Cost'].replace('', np.nan, inplace=True)
inventoryValue.dropna(subset=['Avg Cost'], inplace=True)
#here how can I search for all of the rows in inventoryValue[Item Number] based on Listings[Item Number]
So basically I need to use Item Number column in listings to find rows with matching Item Number in inventoryValue, from there I can get the columns I need in Inventory Value and save the file.
Any help is much appreciated!