EDIT 6/20/18:
As pointed out by @aydow, this is similar to this: How to suppress Pandas Future warning ?
The solution from that page did get rid of the warning for me:
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
However, there is no discussion of why (once I run pd.date_range) I get the warning for every command I enter into the console.
/end edit 6/20/18
First post, so my apologies if I mess anything up or leave out any critical information. I'm also fairly new to python, so its very possible that I'm making a stupid mistake somewhere. However, I can't find any info on this problem.
I'm calling the warning "sticky" for lack of better vocabulary on my part - once I get the warning once (it shows up after running pandas.date_range), I get the same warning pretty much regardless of what I enter into the python console. Details of what I'm trying to do and the results are below.
Thanks-in-advance for any help,
-Jeremy
Task:
Given a start year, a number of bins, and a timestep, I'm trying to create a series of timestamps using the pandas date_range function. Sample code:
import pandas as pd
NumBins = 10
timestep=3
startYr = 2018
BinList =
pd.date_range(start='1/1/'+str(startYr),periods=NumBins,freq=str(timestep)+'min')
While this does result in the expected output (10 timestamps at 3-minute intervals starting at midnight on Jan 1, 2018), I get the following warning message:
C:\Users\mattje\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()
QUESTION:
Why does this warning message start showing up after I've run the date_range function regardless of what variable I try to inspect?
For example, if I run the first 4 lines of code and then enter 'timestep' into the console I get the following, I get the following (note the lack of warning after the output):
import pandas as pd
NumBins = 10
timestep=3
startYr = 2018
timestep
Out[2]: 3
After I run the
pd.date_range(start='1/1/'+str(startYr),periods=NumBins,freq=str(timestep)+'min')
line, I get the following when I enter 'timestep' into the console:
timestep
Out[4]: 3C:\Users\mattje\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()
If I make a new variable, I get:
test = 5
C:\Users\mattje\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()
If I import numpy I get:
import numpy as np
C:\Users\mattje\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()
OTHER INFO
Try the following:
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)