Data Interview Qs - Volume weighted price average (VWAP)

InterviewQs

Volume weighted price average (VWAP)

Data Analysis Python Pandas Data Manipulation Normalization External Dataset

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

Suppose you're given the following table, showing open and close prices as well as trading volume for a particular equity.

Close Open Volume
2019-01-01 0.214420 1.808281 759
2019-01-02 0.338620 0.254375 1324
2019-01-03 1.051536 1.151315 1787
2019-01-04 0.911552 0.455321 2908
2019-01-05 0.997130 0.359723 713
2019-01-06 0.426184 0.987991 2330
2019-01-07 0.376917 0.307812 2592
2019-01-08 0.543065 0.136257 1265
2019-01-09 1.678835 0.836795 2674
2019-01-10 0.481132 0.790461 2508
2019-01-11 0.091329 0.910299 806
2019-01-12 0.308104 0.843959 647
2019-01-13 0.698701 0.947239 2351
2019-01-14 0.878822 1.046117 2840
2019-01-15 1.159343 0.427352 2302

In Python, write code to show the volume weighted average price (VWAP) for a rolling 2-day window. The VWAP is calculated as [(Price * Volume) / Volume].

In this case, your resultant table would start on 1/3/2019 and roll daily from there.



 

Congratulations! You’ve accumulated 148 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

Testing user conversion

Friday, June 11, 2021

Data Analysis, Python, Pandas, Statistics, T-test, External Dataset, InterviewQs Testing user conversion Data Analysis Python Pandas Statistics T-test External Dataset Forward this email to a friend or

Multiply array values, return the remainder

Wednesday, June 9, 2021

Python, Data Structures, Arrays, InterviewQs Multiply array values, return the remainder Python Data Structures Arrays Forward this email to a friend or colleague and challenge them to solve it.

Calculating monthly sales growth in SQL

Monday, June 7, 2021

SQL, Database Querying, Lag Function, Window Function, InterviewQs Calculating monthly sales growth in SQL SQL Database Querying Lag Function Window Function Forward this email to a friend or colleague

Chipotle total revenue per item

Friday, June 4, 2021

Data Analysis, Python, Pandas, Data Manipulation, Data Visualization, External Dataset, InterviewQs Chipotle total revenue per item Data Analysis Python Pandas Data Manipulation Data Visualization

Rainy flights

Wednesday, June 2, 2021

Statistics, Probability Theory, Conditional Probability, InterviewQs Rainy flights Statistics Probability Theory Conditional Probability Forward this email to a friend or colleague and challenge them

You Might Also Like

Software Testing Weekly - Issue 217

Monday, April 29, 2024

How do you deal with conflicts in QA? ⚔️ View on the Web Archives ISSUE 217 April 29th 2024 COMMENT Welcome to the 217th issue! How do you deal with conflicts in QA? Ideally, you'd like to know how

📧 Did you watch the free MMA chapters? (1+ hours of content)

Monday, April 29, 2024

Did you watch the free MMA chapters? Hey there! 👋 I wish you a fantastic start to the week. Last week, I launched Modular Monolith Architecture. More than 300+ students are already deep into the MMA

WP Weekly 191 - Essentials - Duplicate in Core, White Label Kadence, Studio for Mac

Monday, April 29, 2024

Read on Website WP Weekly 191 / Essentials It seems many essential features are being covered in-house, be it the upcoming duplicate posts/pages feature in the WordPress core or the launch of Studio

SRE Weekly Issue #422

Monday, April 29, 2024

View on sreweekly.com A message from our sponsor, FireHydrant: FireHydrant is now AI-powered for faster, smarter incidents! Power up your incidents with auto-generated real-time summaries,

Quick question

Sunday, April 28, 2024

I want to learn how I can better serve you ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Kotlin Weekly #404 (NOT FOUND)

Sunday, April 28, 2024

ISSUE #404 28st of April 2024 Announcements Kotlin Multiplatform State of the Art Survey 2024 Help to shape and understand the Kotlin Multiplatform Ecosystem! It takes 4 minutes to fill this survey.

📲 Why Is It Called Bluetooth? — Check Out This AI Text to Song Generator

Sunday, April 28, 2024

Also: What to Know About Emulating Games on iPhone, and More! How-To Geek Logo April 28, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your

Daily Coding Problem: Problem #1425 [Easy]

Sunday, April 28, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. Suppose an arithmetic expression is given as a binary tree. Each leaf is an

PD#571 Software Design Principles I Learned the Hard Way

Sunday, April 28, 2024

If there's two sources of truth, one is probably wrong. And yes, please repeat yourself. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

When Procrastination is Productive & Ghost integrating with ActivityPub

Sunday, April 28, 2024

Automattic, Texts, and Beeper join forces to build world's best inbox, Reflect launches its iOS app, how to start small rituals, and a lot more in this week's issue of Creativerly. Creativerly