Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using PySpark Count the number of event and odd numbers from a list Input: [35, 45, 46, 30, 30, 30, 34, 23, 38, 43, 48,
Using PySpark
Count the number of event and odd numbers from a list
Input:
[35, 45, 46, 30, 30, 30, 34, 23, 38, 43, 48, 26, 13, 46, 10, 20, 37, 34, 39, 21]
Output:
{0: 12, 1: 8}
- Map
- Check whether even (1) or odd (0) and put 1
- Reduce
- Count the total no. of 1s and 0s
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started