Skip to content

Commit

Permalink
use norm
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Oct 2, 2024
1 parent 73e2709 commit a610fe6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dp_creator_ii/mock_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import namedtuple
import polars as pl
from scipy.stats import norm

ColumnDef = namedtuple("ColumnDef", ["min", "max"])

Expand All @@ -9,7 +10,7 @@ def mock_data(column_defs, row_count=1000):
data = {column_name: [] for column_name in column_defs.keys()}
for i in range(row_count):
for column_name, column_def in column_defs.items():
scale = column_def.max - column_def.min
value = scale * i / row_count + column_def.min
quantile = i / row_count / 2 + 0.25 # ie, 25th to 75th percentiles
value = norm.ppf(quantile)
data[column_name].append(value)
return pl.DataFrame(data=data, schema=schema)

0 comments on commit a610fe6

Please sign in to comment.