对大家有帮助的问答会被标记为“推荐”,看完课程过来浏览一下别人提的问题,会帮你学得更全面
#导入 3D 包 from mpl_toolkits.mplot3d import Axes3D #创建 X、 Y、 Z 坐标 X=[1,1,2,2] Y=[3,4,4,3] Z=[1,100,1,1] fig = plt.figure() # 创建了一个 Axes3D 的子图放到 figure 画布里面 ax = Axes3D(fig) ax.plot_trisurf(X, Y, Z) plt.show()
为什么我的绘制三维图像代码运行的结果是下面这样的?
老师你好,为什么我用的是anaconda ,打开jupyter noteboook却用不了pandas,他那里显示 No module named 'pandas'
对于多维数组转置有点不理解,我看资料上说多维数组转置就是将数据维度顺序反过来,比如:
a=np.arange(0,120).reshape(2,3,4,5) print('数组维度:',a.shape) print('转置数组维度:',a.transpose().shape)
运行结果:
但是资料上示例:
aaa=np.arange(1,37).reshape(1,3,3,4) print(aaa.shape) print(np.transpose(aaa,[1,2,3,0]).shape)
运行结果:
这里不明白是什么意思? 参数[1,2,3,0]是指的什么?
老师 问一个pyinstaller打包问题。为啥本地运行没问题,打包成功了却运行不了。源代码
import speech_recognition as sr
infile='demo.wav'
r=sr.Recognizer()
with sr.AudioFile(infile) as f:
b=r.record(f)
with open('demo1.txt','a',encoding='utf-8') as g:
g.write(r.recognize_sphinx(b,language='zh-CN'))
错误提示:
删除dist及build文件夹,修改spec文件:
运行pyinstaller try.spec报错没有变化
将用到的模块路径加入环境变量,打包时指定模块路径,pyinstaller try.py -F -p E:\anaconda\Lib\site-packages没有效果,报错内容一模一样。
使用pyinstaller try.py -F –-hidden-import pocketsphinx打包没有效果,报错内容一样。
显式的导入缺失的包,报错少一项,但仍报缺失sphinxbase._ad_win32
import speech_recognition as sr, PocketSphinx, sphinxbase._ad_win32
infile='demo.wav'
r=sr.Recognizer()
with sr.AudioFile(infile) as f:
b=r.record(f)
with open('demo1.txt','a',encoding='utf-8') as g:
g.write(r.recognize_sphinx(b,language='zh-CN'))
老师 三维数组[[[1,2,3,4,5]]]展开是一种怎样的形式呢?而且[1,2,3]与[1 2 3]是等效的吗?