Search code examples
pythonpandasseriespython-itertools

Why pandas deprecation of iteritems() is influencing the pd.DataFrame().columns?


I have a code that is using pandas everywhere. In various instances, wheather I am using Series or just calling .columns method, I receive this warning:

C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.3\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_utils.py:609: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
  for item in s.iteritems():

I am not using iteritems() directly. Why do I have this warning message?

Should I worry about it? Will my code be compatible with future versions?


Solution

  • Likely, it is caused by "old" version of Pycharm that you use. If the issue will occur again, please try with updating your Pycharm version to at least 2022.3.1. For more details have a look on: https://youtrack.jetbrains.com/issue/PY-56361/FutureWarning-pandas.Series.iteritems-in-pydevdutils.py