{
  "id": "python/pandas-futurewarning-downcasting",
  "signature": "FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version.",
  "signature_zh": "FutureWarning: 在 .fillna、.ffill、.bfill 上对 object dtype 数组进行向下转型已被弃用，未来版本将改变。",
  "regex": "FutureWarning:\\ Downcasting\\ object\\ dtype\\ arrays\\ on\\ \\.fillna,\\ \\.ffill,\\ \\.bfill\\ is\\ deprecated\\ and\\ will\\ change\\ in\\ a\\ future\\ version\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "pandas 2.1+ deprecates implicit downcasting when filling object-dtype Series. Future versions will preserve object dtype.",
  "root_cause_type": "generic",
  "root_cause_zh": "pandas 2.1+ 弃用了填充 object dtype Series 时的隐式向下转型。未来版本将保留 object dtype。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Behavior will still change in future pandas",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Can raise on incompatible columns",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Explicitly cast: df['col'] = df['col'].astype('float64').fillna(0)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use pd.set_option('future.no_silent_downcasting', True) to opt in early",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-17",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}