摘要:
一 np.random.rand(100) import numpy as np x=np.random.rand(100)print x 生成 一个一行,100列的一维数组,数值在0-1之间的小数 二 np.arange(5) np.arange(5) 返回一个array对象 array([0,1 阅读全文
摘要:
当使用Python编程时,编码问题一直很让人头疼,程序中经常会碰到如下错误提示: UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position 1: ordinal not in range(128) 这是由于python在 阅读全文
摘要:
s = "图片picture"print chardet.detect(s) for c in s.decode('utf-8'): print c UnicodeEncodeError: 'ascii' codec can't encode character u'\u5728' in posit 阅读全文
摘要:
tensorflow 中tf.nn.seq2seq.sequence_loss_by_example to tf.contrib.legacy_seq2seq.sequence_loss_by_example tf.nn.rnn_cell. to tf.contrib.rnn. 1.0修改了很多地方 阅读全文
摘要:
sudo pip install --upgrade tensorflow-gpu Operation not permitted: '/tmp/pip-Sx_vMg-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/ 阅读全文
摘要:
django 在make migrate时碰到,解决办法,在mysql wordbench中将表格id字段设置为自增即可, 原因是id字段设置了非空,却没有默认值,设置自增就有了默认值 设置一下自动增长,如下图: 问题消失,可以正常添加了 阅读全文
摘要:
设置虚拟主机 [plain] view plain copy print? <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/usr/docs/dummy-host.example.com" 阅读全文
摘要:
Task: Start Apache 2 Server /启动apache服务# /etc/init.d/apache2 startor$ sudo /etc/init.d/apache2 startTask: Restart Apache 2 Server /重启apache服务# /etc/in 阅读全文
摘要:
之所以会出现MySQL或者mysqldump这样的命令找不到, 我们可以打开/usr/bin文件夹,发现bin目录中并没有mysql打头的UEF文件, 而在/usr/local/mysql/bin中可以找到这样的文件, 说明mysql的命令默认安装路径是不在bin目录中的, 因而我们需要在环境变量中 阅读全文
摘要:
用Django shell: 1 python manage.py shell 1 python manage.py shell 1 python manage.py shell python manage.py shell 然后获取你的用户名,并且重设密码: 1 2 3 4 from django 阅读全文