Spyder: Spyder (Python 3.6) + Pandas 0.23 - Future Warning

Created on 20 Jun 2018  路  7Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [x] Restarted Spyder

    • [ ] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [x] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

'FutureWarning' generated in error - appears to be a bug. Fresh install of Spyder Python 3.6.5 via Anaconda, just two lines of code in a new console (below) begin to trigger error - after a multi-hour work session. Thank you!

What steps reproduce the problem?

  1. import pandas as pd
  2. nov17_3mo = pd.date_range(end='2017-11-01', periods=3, freq='MS')
  3. 3.

What is the expected output? What do you see instead?

Object is created as requested - but I get additional error:
C:\Users\pjacob\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\widgets\variableexplorer\utils.py:414: FutureWarning: 'summary' is deprecated and will be removed in a future version.
display = value.summary()

Once it starts, this error comes up after every line of code executed in the console, e.g., print(1+1)

Paste Traceback/Error Below (if applicable)


PASTE TRACEBACK HERE

Versions

  • Spyder version: 3.2.8
  • Python version: 3.6.5
  • Qt version: 5.9.4
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10

Dependencies

PASTE DEPENDENCIES HERE

IPython >=4.0 : 6.4.0 (OK)
cython >=0.21 : 0.28.2 (OK)
jedi >=0.9.0 : 0.12.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.14.3 (OK)
pandas >=0.13.1 : 0.23.0 (OK)
pycodestyle >=2.3: 2.4.0 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.7.4 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

IPython Console Bug

All 7 comments

Pandas has deprecated Index.summary() in favor of Index._summary() as per:

Issue: https://github.com/pandas-dev/pandas/issues/18217
PR: https://github.com/pandas-dev/pandas/pull/20028

Thank you, quite helpful - but note a couple of issues: (1) Once this warning occurs, ANY executed statement provokes the warning, for example: print(1+1). Also, since the old Index.summary() is invoked by certain DateTimeIndex object references, the warning is triggered - and repeats continuously - without a direct invocation of Index.summary().

Yes clearly this needs to be fixed.

If you want you can test a possible workaround, try changing:

C:\Users\pjacob\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\widgets\variableexplorer\utils.py line 414

from

display = value.summary()

to

display = value._summary()

and see if that fixes the problem. Then we will have a possible solution.

That fixes the problem for me.

I'm having the same problem. Another workaround is to suppress the message with:

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

Great, thanks very much for the help & focus on this.

@dalthviz, please help me to solve this one. Here

https://travis-ci.org/spyder-ide/spyder/jobs/395955090#L1512

you can find here all warnings generated by the latest Pandas.

For each one please do the following:

try:
    display = value._summary()
except AttributeError:
    display = value.summary()

This is for summary, but you get the idea for the rest of them: the new method name must be called first and the old one second. This way we will guarantee compatibility with old Pandas versions and avoid these warnings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cchu08 picture cchu08  路  3Comments

JesterEE picture JesterEE  路  3Comments

goanpeca picture goanpeca  路  3Comments

spyder-bot picture spyder-bot  路  3Comments

hedeqing picture hedeqing  路  3Comments