Issue
import pandas
in_stock = pandas.read_csv("instock.csv")
new_data = pandas.read_csv("new_data.csv")
in_stock_list = in_stock.asset_tag.to_list()
new_data_list = new_data.asset_tag.to_list()
missing_list = [items for items in in_stock_list if items not
in new_data_list]
bad_status_list = [items for items in new_data_list if items
not in in_stock_list]
results = {
"Missing Assets": [missing_list],
"Wrong Status": [bad_status_list]
}
This creates a single row with all the values in there instead of multiple rows.
Solution
Can you provide a snippet of the CSV files you are using. Based on what I see, the missing_list and bad_status_list should contain values within lists. I'm not sure why you would want to put them inside another list, but maybe I'm misunderstanding what you're trying to do here.
Remove the brackets within your results dictionary and see if that resolves your issue.
results = {
"Missing Assets": missing_list,
"Wrong Status": bad_status_list
}
Answered By - jp207
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.