{"id":4189,"library":"pydoe","title":"PyDOE: An Experimental Design Package for Python","description":"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.","status":"active","version":"0.9.9","language":"en","source_language":"en","source_url":"https://github.com/pydoe/pydoe","tags":["DOE","design of experiments","experimental design","statistics","optimization","factorial design","latin hypercube","response surface"],"install":[{"cmd":"pip install pydoe","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Fundamental for numerical operations and array manipulation.","package":"numpy"},{"reason":"Provides scientific computing tools, often used in statistical analysis and optimization.","package":"scipy"}],"imports":[{"note":"For 2-level full-factorial designs.","symbol":"ff2n","correct":"from pydoe import ff2n"},{"note":"For Latin Hypercube Sampling.","symbol":"lhs","correct":"from pydoe import lhs"},{"note":"For Central-Composite Designs.","symbol":"ccdesign","correct":"from pydoe import ccdesign"}],"quickstart":{"code":"import numpy as np\nfrom pydoe import ff2n\n\n# Create a 2^3 full-factorial design (3 factors, each at 2 levels)\ndesign = ff2n(3)\nprint(\"2^3 Full-Factorial Design Matrix:\")\nprint(design)\n\n# Example of Latin Hypercube Sampling (LHS) for 2 variables, 5 samples\nfrom pydoe import lhs\nlhs_samples = lhs(2, samples=5)\nprint(\"\\nLatin Hypercube Samples (2 variables, 5 samples):\")\nprint(lhs_samples)","lang":"python","description":"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."},"warnings":[{"fix":"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).","message":"Older versions of `pydoe` (prior to 0.9.x) were not compatible with Python 3 directly, primarily due to changes in the division operator. Attempts to use them with Python 3.x often resulted in `SyntaxError` or `TypeError`. The current version (>=0.9.x) explicitly requires Python >=3.10.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"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.","message":"Historically, several forks like `pyDOE2` and `pyDOE3` emerged due to perceived inactivity or unaddressed bugs in the original `pydoe`. While these forks offered updates and new features, the official `pydoe` project is now actively maintained and aims to integrate these improvements.","severity":"gotcha","affected_versions":"All"},{"fix":"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`).","message":"In `pydoe` versions before 0.9.x, users might have encountered `DEPRECATION: pyDOE is being installed using the legacy 'setup.py install'` warnings due to the absence of a `pyproject.toml` file.","severity":"gotcha","affected_versions":"<0.9.0"},{"fix":"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.","message":"Some functions, like `ccdesign`, in older `pydoe` versions were reported to have issues with specific `numpy` versions, leading to `TypeError: can't multiply sequence by non-int of type 'numpy.float64'`.","severity":"gotcha","affected_versions":"<0.9.x"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}