{"record":{"id":"de14bdd403ac7c80","repo":"microsoft/qlib","slug":"this-type-of-input-is-not-supported-de14bd","errorCode":null,"errorMessage":"This type of input is not supported","messagePattern":"This type of input is not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/data/dataset/processor.py","lineNumber":310,"sourceCode":"        X -= self.mean_train\n        X /= self.std_train\n        if self.clip_outlier:\n            X = np.clip(X, -3, 3)\n        df[self.cols] = X\n        return df\n\n\nclass CSZScoreNorm(Processor):\n    \"\"\"Cross Sectional ZScore Normalization\"\"\"\n\n    def __init__(self, fields_group=None, method=\"zscore\"):\n        self.fields_group = fields_group\n        if method == \"zscore\":\n            self.zscore_func = zscore\n        elif method == \"robust\":\n            self.zscore_func = robust_zscore\n        else:\n            raise NotImplementedError(f\"This type of input is not supported\")\n\n    def __call__(self, df):\n        # try not modify original dataframe\n        if not isinstance(self.fields_group, list):\n            self.fields_group = [self.fields_group]\n        # depress warning by references:\n        # https://stackoverflow.com/questions/20625582/how-to-deal-with-settingwithcopywarning-in-pandas\n        # https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html#getting-and-setting-options\n        with pd.option_context(\"mode.chained_assignment\", None):\n            for g in self.fields_group:\n                cols = get_group_columns(df, g)\n                df[cols] = df[cols].groupby(\"datetime\", group_keys=False).apply(self.zscore_func)\n        return df\n\n\nclass CSRankNorm(Processor):\n    \"\"\"\n    Cross Sectional Rank Normalization.","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/dataset/processor.py#L292-L328","documentation":"Raised by CSZScoreNorm (cross-sectional z-score processor, qlib/data/dataset/processor.py) when its method argument is neither \"zscore\" nor \"robust\". The processor maps the method string to a normalization function at construction time; any other string has no implementation. It is a constructor argument error, not a data error.","triggerScenarios":"CSZScoreNorm(method=\"minmax\"), CSZScoreNorm(method=\"ZScore\") (case-sensitive), or passing method=None. Occurs when building processor lists in DataHandlerLP config, e.g. processors: [{\"class\": \"CSZScoreNorm\", \"kwargs\": {\"method\": \"z-score\"}}].","commonSituations":"Copy-pasting processor configs from examples and editing the method; assuming case-insensitive matching; confusing this processor with CSRankNorm or ZScoreNorm which have different options. The only valid values are \"zscore\" (standard) and \"robust\" (median/MAD-based, robust to outliers).","solutions":["Use method=\"zscore\" for standard cross-sectional z-score or method=\"robust\" for robust z-score (median and MAD).","Check spelling and case: the comparison is exact equality against \"zscore\" and \"robust\".","If you need min-max or rank normalization, use the appropriate processor class (e.g. CSRankNorm,MinMaxProcessor) instead of CSZScoreNorm."],"exampleFix":"# before\nproc = CSZScoreNorm(fields_group=\"feature\", method=\"minmax\")\n\n# after\nproc = CSZScoreNorm(fields_group=\"feature\", method=\"zscore\")  # or \"robust\"","handlingStrategy":"validation","validationCode":"VALID = {\"zscore\", \"robust\"}\nmethod = method if method in VALID else \"zscore\"  # or raise early with a clear message","typeGuard":"def is_csz_method(m: str) -> bool:\n    return m in (\"zscore\", \"robust\")","tryCatchPattern":"try:\n    proc = CSZScoreNorm(fields_group=g, method=m)\nexcept NotImplementedError:\n    logger.warning(\"unsupported CSZScoreNorm method %s; falling back to zscore\", m)\n    proc = CSZScoreNorm(fields_group=g, method=\"zscore\")","preventionTips":["Keep a whitelist of supported processor methods next to your config builder.","Validate processor kwargs with jsonschema or pydantic before init_instance_by_config."],"tags":["qlib","processor","normalization","config"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}