Searching a Python Dictionary with multiple values
Searching a Python Dictionary with multiple values I have data in the following csv file, available here: http://s000.tinyupload.com/index.php?file_id=87473936848618674050 Screenshot of the CSV: I've written the following code to import the CSV file into Python as a Pandas Dataframe, and then the code after that creates a Dict. The dictionary has to have name and region as the keys, and the Windows and Linux prices as the dictionary values. #Import libraries and CSV file into dataframe, renaming columns, printing head import pandas as pd df = pd.read_csv('file.csv') col_names = ['Name','Region','API', 'Memory','vCPU', 'Storage', 'Linux', 'Windows' ] df.columns = col_names #Creating Dict dict = {} for i in df.index: key = (df.at[i, 'Name'] , df.at[i, 'Region']) #Rename columns accordingly value = (df.at[i, 'vCPU'], df.at[i, 'Memory'], df.at[i, 'Storage'], df.at[i, ...