{"id":21780,"library":"pypots","title":"PyPOTS","description":"A Python toolbox for machine learning on partially-observed time series. Current version 1.4, released with bug fixes. Active development with frequent releases.","status":"active","version":"1.4","language":"python","source_language":"en","source_url":"https://github.com/WenjieDu/PyPOTS","tags":["time-series","imputation","forecasting","classification","anomaly-detection","machine-learning","missing-data"],"install":[{"cmd":"pip install pypots","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"The main package; no common wrong pattern.","symbol":"pypots","correct":"import pypots"}],"quickstart":{"code":"import pypots\nfrom pypots.utils.random import set_random_seed\nimport numpy as np\n\n# Generate random data with missing values\nX = np.random.randn(100, 10, 5)\nX[X < -1] = np.nan  # introduce missing values\n\n# Impute using a simple model\nfrom pypots.imputation import SAITS\n\nmodel = SAITS(\n    n_steps=10,\n    n_features=5,\n    n_layers=2,\n    d_model=32,\n    d_ffn=64,\n    n_heads=4,\n    d_k=16,\n    d_v=16,\n    epochs=10,\n    batch_size=32,\n    loss_fn='mse',\n    optimizer='adam',\n    lr=1e-3,\n    verbose=True\n)\nmodel.fit(X)\nimputed_X = model.impute(X)\nprint(imputed_X.shape)","lang":"python","description":"Impute missing values in 3D time series data using SAITS."},"warnings":[{"fix":"Ensure input shape is (n_samples, n_timesteps, n_features).","message":"PyPOTS requires data in 3D numpy arrays (samples, timesteps, features). Passing 2D or 4D arrays will cause errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use correct import paths as shown in official docs.","message":"The old import 'from pypots.data import ...' is deprecated. Use 'from pypots.utils.random import ...' instead.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Refer to the migration guide at https://pypots.readthedocs.io/en/latest/release.html","message":"In v1.0, the API changed significantly. Many model classes and utilities moved to new subpackages.","severity":"breaking","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Reshape data to 3D: data = data.reshape(n_samples, -1, n_features) or add a dimension.","cause":"Input data is 2D instead of 3D (n_samples, n_timesteps, n_features).","error":"ValueError: Expected data to be 3D, got 2D"},{"fix":"Use 'from pypots.utils.random import set_random_seed' or other correct imports from actual subpackages.","cause":"Trying to import from the old 'pypots.data' subpackage which was removed in v1.0.","error":"ModuleNotFoundError: No module named 'pypots.data'"},{"fix":"Upgrade to pypots>=1.2.","cause":"Known bug in TimeLLM model when loading pretrained LLM, fixed in v1.2.","error":"AttributeError: 'NoneType' object has no attribute 'endswith'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}