Interview Query

Density to Cumulative

Start Timer

0:00:00

Upvote
2
Downvote
Save question
Mark as completed
View comments (14)
Next question

Given a list pdf write a function to_cdf(pdf) to caluculate the cdf.

Example:

Input:

def to_cdf(pdf) 
      return(cdf) ->

#Input
pdf = [1.2,3.4,5.3]

Output:

#output 

cdf = [1.2,4.6,9.9]

Note: Round the numbers to 3 digits.

.
.
.
.
.


Comments

Loading comments