I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

Talk:Modified random distribution

From Rosetta Code

Python plots[edit]

RC can only handle text, but the following appended to the Python solution produces pretty plots.

if __name__ == '__main__':
import pandas as pd
x, y = zip(*[(x / 1001, modifier(x / 1001)) for x in range(1001)])
dfm = pd.DataFrame({'x': x, 'modifier(x)': y})
dfm.plot.line(x='x', title='Probability Modifier')
df = pd.DataFrame({'data': data})
df.plot.hist(bins=21, title='Histogram of generated numbers')

--Paddy3118 (talk) 00:41, 26 February 2021 (UTC)