How to transfer some information from one CSV to another CSV using python

I have two CSV files one large CSV file (Stock.csv) that contains all the information and another one contains partial information(Sold.csv)

Example of the large CSV file(Stock.csv)
    Item_No       Price     
    1             20        
    2             10        
    3             9.99      
    4             11  
    5             13
    6             11
    7             7.99

  

the other CSV file contains only the sold items by Item_No with no price) which are now needed

Example of the other CSV file(Sold.csv)
    Item_No       Price 
    1             
    4      
    7

as you can see it only contains the Item_No , how can I add the price of each Item_No (The file contains more than 30000 items, doing it manually will take ages)

Answer

Try:

df1 = pd.read_csv("Stock.csv", sep=r"s+")  # <-- adjust separator accordingly
df2 = pd.read_csv("Sold.csv", sep=r"s+")

df2["Price"] = df2["Item_No"].map(df1.set_index("Item_No")["Price"])
print(df2)
df2.to_csv("output.csv", index=False)

Prints:

   Item_No  Price
0        1  20.00
1        4  11.00
2        7   7.99

and creates output.csv.