How to find MIN, MAX in a Dictionary?

How to find MIN, MAX in a Dictionary?

How to find MIN, MAX in a Dictionary?

This recipe helps you find MIN, MAX in a Dictionary

This data science python tutorial does the following; 1. Creates your own dictionary 2. Uses "zip" function to iterate over multiple values 3. Prints max and min value of a dictionary
In [1]:
## How to find MIN, MAX in a Dictionary
def Kickstarter_Example_57():
    print(format('How to find MIN, MAX in a Dictionary','*^82'))
    import warnings

    # Create A Dictionary
    ages = {'John': 21, 'Mike': 52, 'Sarah': 12, 'Bob': 43}

    # Find The Maximum Value Of The Values
    print('Maximum Value: '); print(max(zip(ages.values(), ages.keys())))

    print('Maximum Value: '); print(min(zip(ages.values(), ages.keys())))

***********************How to find MIN, MAX in a Dictionary***********************

Maximum Value:
(52, 'Mike')

Maximum Value:
(12, 'Sarah')

Relevant Projects

Data Science Project-All State Insurance Claims Severity Prediction
Data science project in R to develop automated methods for predicting the cost and severity of insurance claims.

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.

Data Science Project-TalkingData AdTracking Fraud Detection
Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

Data Science Project - Instacart Market Basket Analysis
Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.

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.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

Music Recommendation System Project using Python and R
Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.