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 - Instacart Market Basket Analysis
Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

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.

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Learn to prepare data for your next machine learning project
Text data requires special preparation before you can start using it for any machine learning project.In this ML project, you will learn about applying Machine Learning models to create classifiers and learn how to make sense of textual data.

Walmart Sales Forecasting Data Science Project
Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

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

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Zillow’s Home Value Prediction (Zestimate)
Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

Machine Learning or Predictive Models in IoT - Energy Prediction Use Case
In this machine learning and IoT project, we are going to test out the experimental data using various predictive models and train the models and break the energy usage.

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.