PyDOE is a Python package for design of experiments (DOE), enabling scientists, engineers, and statisticians to efficiently construct experimental designs. It provides extensive support for various DOE methods, including factorial, response-surface, and space-filling designs. The project is actively maintained, with a focus on integrating features from its community forks into the main package.
pip install pydoeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to generate a 2-level full-factorial design and Latin Hypercube samples using pydoe. The `ff2n(n)` function creates a 2^n factorial design, and `lhs(n, samples)` generates 'samples' points for 'n' variables using Latin Hypercube Sampling.
Ensure you are using `pydoe` version 0.9.0 or higher with Python 3.10+ (`pip install pydoe`). If maintaining older Python 3 versions, consider `pyDOE2` or manually patching older `pydoe` versions (though not recommended).
For new projects, prefer the official `pydoe` package (`pip install pydoe`). Existing users of `pyDOE2`/`pyDOE3` are encouraged to monitor `pydoe`'s development for migration back to the main branch for long-term support.
This issue has been addressed in `pydoe` version 0.9.x and newer, which includes `pyproject.toml` for modern build processes. Upgrade to the latest `pydoe` version to resolve this (`pip install --upgrade pydoe`).
Ensure both `pydoe` and its dependencies (`numpy`, `scipy`) are updated to their latest compatible versions. If an issue persists, consult the `pydoe` GitHub issues or documentation for known compatibility notes.
Upgrade to a newer version of `pydoe` (0.9.9 or newer) that is compatible with your Python version, or use `pyDOE2` which has addressed this issue. If updating is not an option, manually locate the file (e.g., `doe_factorial.py` within the installed package directory) and replace `import imp` with `import importlib`.
Ensure you are using `pydoe` version 0.9.9 or newer, as recent updates aim to improve compatibility. Alternatively, many users resolved this by switching to the `pyDOE2` fork, which specifically addressed such bugs.
Install the package using pip: `pip install pydoe`. Double-check the spelling in your import statement (e.g., `from pydoe import fullfact`). If using virtual environments, ensure the correct environment is activated before running your script.