How to deal with Dictionary Basics in Python?
DATA MUNGING DATA CLEANING PYTHON MACHINE LEARNING RECIPES PANDAS CHEATSHEET     ALL TAGS

How to deal with Dictionary Basics in Python?

How to deal with Dictionary Basics in Python?

This recipe helps you deal with Dictionary Basics in Python

0

Recipe Objective

Have you tired to change values in dictionary or print some of the values?

So this is the recipe on how we can work with Dictionary Basics in Python.

Step 1 - Creating Dictionary

unef_org = {"name" : "UNEF", "staff" : 32, "url" : "http://unef.org"} print(unef_org)

We have created a dictionary and printed it.

Step 2 - Changing the dictionary

We have changed the values by assining new values to the features. who_org = {} who_org["name"] = "WHO" who_org["staff"] = "10" who_org["url"] = "https://setscholars.com" print(who_org)

Step 3 - Viewing few values

We have created a new dictionary and printed the desired value by passing the index of the value. unitas_org = {"name" : "UNITAS", "staff" : 32, "url" : ["https://setscholars.com", "https://setscholars.info"]} print(unitas_org) print(unitas_org["url"]) print(unitas_org["url"][0]) print(unitas_org["url"][1]) So the output comes as

{"name": "UNEF", "staff": 32, "url": "http://unef.org"}

{"name": "WHO", "staff": "10", "url": "https://setscholars.com"}

{"name": "UNITAS", "staff": 32, "url": ["https://setscholars.com", "https://setscholars.info"]}

["https://setscholars.com", "https://setscholars.info"]

https://setscholars.com

https://setscholars.info

Relevant Projects

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

Sequence Classification with LSTM RNN in Python with Keras
In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Dataset​ using Keras in Python.

Perform Time series modelling using Facebook Prophet
In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.

German Credit Dataset Analysis to Classify Loan Applications
In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

Deep Learning with Keras in R to Predict Customer Churn
In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

Ecommerce product reviews - Pairwise ranking and sentiment analysis
This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

Data Science Project on Wine Quality Prediction in R
In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Solving Multiple Classification use cases Using H2O
In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.