Price per calorie of various snack foods

InterviewQs

Price per calorie of various snack foods

Data Analysis Python Pandas Data Manipulation

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Suppose you are given the following dataset containing food, servings per container, calories per serving, and price per container. You'll notice that each food's price, serving size, and servings per container widely varies. Create a sorted list (lowest to highest) with the food and the associated price per calorie. Below is code to generate the dataframe, or you can also make a copy of this Google Colab notebook to get started.

    

# code to import data

import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/erood/interviewqs.com_code_snippets/master/Datasets/snackfood.csv')

# preview data

df.head()

Solution will be written in Python for premium users.




 

You’ve accumulated 340 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Older messages

Bubble sort algorithm

Wednesday, August 31, 2022

Sorting, Algorithim, Data Structures, InterviewQs Bubble sort algorithm Sorting Algorithim Data Structures Forward this email to a friend or colleague and challenge them to solve it. Hi, Bubble sort (

Covariance and correlation

Monday, August 29, 2022

Statistics, Covariance, Correlation, InterviewQs Covariance and correlation Statistics Covariance Correlation Forward this email to a friend or colleague and challenge them to solve it. Hi, Explain the

Checking interview scores for accepted candidates

Friday, August 26, 2022

SQL, Database Querying, InterviewQs Checking interview scores for accepted candidates SQL Database Querying Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose your

Correlation between aces and points won in tennis

Wednesday, August 24, 2022

Data Analysis, Python, Pandas, External Dataset, Data Manipulation, Data Visualization, Statistics, Pearson's R, Chi-squared Test, InterviewQs Correlation between aces and points won in tennis Data

Estimate Pi using Monte Carlo methods

Monday, August 22, 2022

Python, Algorithms, Loops, InterviewQs Estimate Pi using Monte Carlo methods Python Algorithms Loops Forward this email to a friend or colleague and challenge them to solve it. Hi, We can define the

[Last chance to register] Learn how to evaluate, build, and launch a faster, relevant, contextual search experience

Thursday, December 8, 2022

Deliver contextual search for a dataset as big as 10M records in only 6 months. elastic | Search. Observe. Protect Learn how to evaluate, build, and launch a faster, relevant, contextual search

Apple GPU drivers now in Asahi Linux — Apple introduces end-to-end encryption for backups — and Tell HN: IPv6-only still pretty much unusable

Wednesday, December 7, 2022

Issue #974 — Top 20 stories of December 08, 2022 Issue #974 — December 08, 2022 You receive this email because you are subscribed to Hacker News Digest. You can open it in the browser if you prefer. 1

Plaid unravels a fifth of its workforce after ‘growth did not materialize as quickly as expected' 

Wednesday, December 7, 2022

TechCrunch Newsletter TechCrunch logo The Daily Crunch logo By Christine Hall Wednesday, December 07, 2022 Hello, and welcome to Hump Day! If you haven't gotten your fill yet of tech egos, you'

Infographic | When Will Air Travel Return to Pre-Pandemic Levels? ✈

Wednesday, December 7, 2022

COVID-19 hit the air travel industry hard. But passenger traffic is slowly recovering, and by 2025, things are expected to return to 'normal.' View Online | Subscribe Presented by: TSX-V: CVV

JSK Daily for Dec 7, 2022

Wednesday, December 7, 2022

JSK Daily for Dec 7, 2022 View this email in your browser A community curated daily e-mail of JavaScript news JSK Weekly - December 07, 2022 Hello festive season! If you're not feeling the

Learn how strong security builds trust and wins customers

Wednesday, December 7, 2022

Join us on Tuesday, December 13 at 10 am PST/1 pm EST for a free, one-hour webinar called, “Prove trust to prospects: How to win deals in an economic downturn.” People do business with companies they

Save Big on an Android TV Projector, Portable SSD, and More

Wednesday, December 7, 2022

Logo for How-To Geek Deals December 7, 2022 Save Big on an Android TV Projector, Portable SSD, and More Welcome back to the first full edition of How-To Geek Deals since the Cyber Weekend rush. To kick

JSK Weekly - December 07, 2022

Wednesday, December 7, 2022

Hello festive season! If you're not feeling the festivities just yet, check out "AdventJS, JavaScript/TypeScript coding challenges on December", it'll make for an interesting run up

Mastering Cyber Intelligence ($19.99 Value) FREE for a Limited Time

Wednesday, December 7, 2022

The Hacker News eBook Update Newsletter Mastering Cyber Intelligence ($19.99 Value) FREE for a Limited Time Download For Free Cyber Threat Intelligence converts threat information into evidence-based

Daily Coding Problem: Problem #958 [Medium]

Wednesday, December 7, 2022

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Facebook. Given an unordered list of flights taken by someone, each represented as (