Skip to content
Advertisement

Tag: series

Plotting CDF of a pandas series in python

Is there a way to do this? I cannot seem an easy way to interface pandas series with plotting a CDF. Answer In case you are also interested in the values, not just the plot. This will always work (discrete and continuous distributions) Alternative example with a sample drawn from a continuous distribution or you have a lot of individual

Print series of prime numbers in python

I was having issues in printing a series of prime numbers from one to hundred. I can’t figure our what’s wrong with my code. Here’s what I wrote; it prints all the odd numbers instead of primes: Answer You need to check all numbers from 2 to n-1 (to sqrt(n) actually, but ok, let it be n). If n is

Advertisement