Describe the bug
Calling dowhy.datasets.linear_dataset with treatment_is_binary=True raises a ValueError on NumPy >= 2.4.0.
Steps to reproduce the behavior
import dowhy.datasets
data = dowhy.datasets.linear_dataset(
beta=10,
num_common_causes=5,
num_instruments=2,
num_samples=1000,
treatment_is_binary=True,
)
Error
ValueError: setting an array element with a sequence.
Full traceback points to datasets.py:297:
t = np.vectorize(convert_to_binary)(t)
Expected behavior
Dataset should be generated without error.
Version information:
- DoWhy version 0.14
- NumPy version 2.4.2
- Python 3.12.3
- OS Linux