Task 4 - Dictionaries, Lists and data manapulation
Contents
Task 4 - Dictionaries, Lists and data manapulation¶
In this part we explore another fundamental data structure in python, called Dictionaries.
4.1: Create a dictionary that has 3 keys: name, age and salary, and enter in the following dummy information.¶
Sample output¶
{‘name’: ‘Tim Cook’, ‘age’: 59, ‘salary’: 3000000.0}
#Your Solution Here
4.2: Create a second dictionary, this time with at least 5 different names, ages, and salaries.¶
Hint: There should only be three keys, and the values should be a list.
Sample Output¶
{‘name’: [‘Tim Cook’, ‘Person 2’, ‘Person 3’], ‘age’: [59, 24, 40], ‘salary’: [30000000.0, 200000.0, 900000.0]}
#Your Solution Here
4.3: Create a pandas dataframe using the dictionary you created above¶
Hint: Use the pd.DataFrame.from_dict()
method