|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
这是错误:
Warning (from warnings module):
File "F:\python\lib\site-packages\ggplot\utils.py", line 81
pd.tslib.Timestamp,
FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access Timestamp as pandas.Timestamp
Warning (from warnings module):
File "F:\python\lib\site-packages\ggplot\stats\smoothers.py", line 4
from pandas.lib import Timestamp
FutureWarning: The pandas.lib module is deprecated and will be removed in a future version. These are private functions and can be accessed from pandas._libs.lib instead
Traceback (most recent call last):
File "F:\练习数据\3.py", line 12, in <module>
import ggplot
File "F:\python\lib\site-packages\ggplot\__init__.py", line 20, in <module>
from .stats import stat_smooth, stat_density
File "F:\python\lib\site-packages\ggplot\stats\__init__.py", line 2, in <module>
from .stat_smooth import stat_smooth
File "F:\python\lib\site-packages\ggplot\stats\stat_smooth.py", line 5, in <module>
from . import smoothers
File "F:\python\lib\site-packages\ggplot\stats\smoothers.py", line 4, in <module>
from pandas.lib import Timestamp
ImportError: cannot import name 'Timestamp' from 'pandas.lib' (F:\python\lib\site-packages\pandas\lib.py)
这是代码:
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import prettyplotlib
import ggplot
mpl.style.use('seaborn-whitegrid');
def sta001(k,nyear,xd):
d2=np.fv(k,nyear,-xd,-xd);
d2=round(d2)
print(nyear,d2)
return d2
def dr_xtyp(_dat):
xtyp=['bmh','dark_background','fivethirtyeight','ggplot','grayscale','default'];
i=0;
for xss in plt.style.available:
plt.figure()
plt.style.use(xss);
_dat.plot()
fss='tmp\\k101_'+xss+'.png';plt.savefig(fss);
i+=1;
print(i,xss,',',fss)
plt.show()
dx05=[sta001(0.05,x,1.4) for x in range(0,40)]
dx10=[sta001(0.10,x,1.4) for x in range(0,40)]
dx15=[sta001(0.15,x,1.4) for x in range(0,40)]
dx20=[sta001(0.20,x,1.4) for x in range(0,40)]
df=pd.DataFrame(columns=['dx05','dx10','dx15','dx20']);
df['dx05']=dx05;df['dx10']=dx10;
df['dx15']=dx15;df['dx20']=dx20;
print(df.tail())
dr_xtyp(df)
有什么问题,怎么解决 |
|