随笔分类 -  python

摘要:本博客参照github上的案例进行学习记录 github地址:https://github.com/ljcan/Hive_Project #下载数据集wget http://files.grouplens.org/datasets/movielens/ml-100k.zip unzip ml-100 阅读全文
posted @ 2019-06-04 10:33 bioamin 阅读(1195) 评论(0) 推荐(0)
摘要:#auther bioamin #nlp of 电商评论 #-*- conding = utf-8 -*- import numpy as np import pandas as pd #画图的包 import matplotlib.pyplot as plt import seaborn as s 阅读全文
posted @ 2019-05-07 21:00 bioamin 阅读(1264) 评论(0) 推荐(0)
摘要:1.登录百度云平台,创建应用 2.编写代码 from aip import AipOcr import codecs import os #读取图片函数 def ocr(path): with open(path,'rb') as f: return f.read() def main(): fil 阅读全文
posted @ 2019-05-07 17:24 bioamin 阅读(2828) 评论(0) 推荐(0)
摘要:1.四个文件 cat A.关系图.xlsx Source Target Weight A B 6 A C 6 A D 7 A E 7 A F 6 A G 5 A H 5 A I 3 A J 6 cat B.关系图.xlsx Source Target Weight B C 7 B D 7 B E 5 阅读全文
posted @ 2019-05-06 21:06 bioamin 阅读(558) 评论(0) 推荐(0)
摘要:1.从网上下载一份 天龙八部的txt文档以及一份通用的jieba停用词表 2.下载一个背景 图片.jpg 3.检查一个字体文件 C:/Windows/Fonts/simsun.ttc # -*- coding:utf-8 -*- import jieba import jieba.analyse f 阅读全文
posted @ 2019-05-06 17:32 bioamin 阅读(1454) 评论(0) 推荐(0)
摘要:anacoda安装的jupyter,使用nginx进行了转发,远程访问可以进去,但是创建文件和创建目录都会报错 浏览器页面报错: 第一次使用jupyter创建python时错误:Creating Notebook Failed An error occurred while creating a n 阅读全文
posted @ 2019-04-23 11:31 bioamin 阅读(4082) 评论(1) 推荐(2)
摘要:在目前的snacoda里集成的sklearn已经不存在cross_validation模块了 使用以下模块 from sklearn.model_selection import train_test_split 阅读全文
posted @ 2019-04-21 20:05 bioamin 阅读(917) 评论(0) 推荐(0)
摘要:百度是有技巧的,现在百度的基本上都是2年前的帖子,对于最新的版本都不适用 对于jupyter自定义目录都是修改配置文件,这个对于jupyter4.4.0不适用; 1、在桌面创建jupyter-noteook的快捷方式 2、右键快捷方式属性,修改以下即可 阅读全文
posted @ 2019-04-21 18:57 bioamin 阅读(289) 评论(0) 推荐(0)
摘要:python -m pip install jupyter_contrib_nbextensions jupyter contrib nbextension install --user --skip-running-check 重启juypter,然后添加一下勾选 阅读全文
posted @ 2019-04-21 18:50 bioamin 阅读(228) 评论(0) 推荐(0)
摘要:多项式特征处理 class sklearn.preprocessing.PolynomialFeatures(degree=2, interaction_only=False, include_bias=True) 参数: degree interaction_only 默认为False inclu 阅读全文
posted @ 2019-04-06 19:52 bioamin 阅读(403) 评论(0) 推荐(0)
摘要:import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D data=np.genfromtxt("Delivery.csv",delimiter=',') x_data = d 阅读全文
posted @ 2019-04-05 10:09 bioamin 阅读(384) 评论(0) 推荐(0)
摘要:Python 并没有提供数组功能,虽然列表 (list) 可以完成基本的数组功能,但它并不是真正的数组,而且在数据量较大时,使用列表的速度就会慢的让人难受。Numpy 提供了真正的数组功能,以及对数据快速处理的函数。Numpy 还是很多更高级的扩展库的依赖库,例如: Scipy,Matplotlib 阅读全文
posted @ 2019-04-01 20:23 bioamin 阅读(3231) 评论(0) 推荐(0)
摘要:假设你有两个Python项目-A和B,这两个项目都需要使用同一个第三方模块-tensorflow。如果这两个项目使用相同的tensorflow版本,也许不会有什么问题。 但是,当A和B项目使用不同的tensorflow版本时-A使用tensorflow 0.70版本;B使用tensorflow 0. 阅读全文
posted @ 2018-11-24 16:49 bioamin 阅读(10902) 评论(0) 推荐(0)
摘要:首先系统自带的python是python2 我们需要安装一个python3(这里的所有源码包都可以在环境中准备好,这样没有网也可以进行安装) 安装python 1.安装环境 # yum -y install zlib-devel bzip2-devel openssl-devel ncurses-d 阅读全文
posted @ 2018-11-19 15:37 bioamin 阅读(3921) 评论(0) 推荐(1)
摘要:•计算一个数字的立方根,不使用库函数 详细描述: •接口说明 原型: public static double getCubeRoot(double input) 输入:double 待求解参数 返回值:double 输入参数的立方根,保留一位小数 牛顿迭代法:之前看到很多人说这种方法,光看代码还是 阅读全文
posted @ 2018-11-09 16:56 bioamin 阅读(6446) 评论(0) 推荐(0)
摘要:不能放弃治疗,每天都要进步!! 什么时候使用动态规划呢? 1. 求一个问题的最优解 2. 大问题可以分解为子问题,子问题还有重叠的更小的子问题 3. 整体问题最优解取决于子问题的最优解(状态转移方程) 4. 从上往下分析问题,从下往上解决问题 5. 讨论底层的边界问题 实例1:割绳子问题 题目:给你 阅读全文
posted @ 2018-09-08 13:51 bioamin 阅读(1021) 评论(0) 推荐(0)
摘要:import numpy as np a = np.array([[1,5,3],[4,2,6]]) print(a.min()) #无参,所有中的最小值 print(a.min(0)) # axis=0; 每列的最小值 print(a.min(1)) # axis=1;每行的最小值 阅读全文
posted @ 2018-07-31 17:24 bioamin 阅读(1306) 评论(0) 推荐(0)
摘要:Python默认是以ASCII作为编码方式的,如果在自己的Python源码中包含了中文(或者其他非英语系的语言),此时即使你把自己编写的Python源文件以UTF-8格式保存了,但实际上,这依然是不行的。解决办法很简单,只要在文件开头加入下面代码就行了 # -*- coding: UTF-8 -*- 阅读全文
posted @ 2018-07-28 09:23 bioamin 阅读(954) 评论(2) 推荐(1)
摘要:import matplotlib import matplotlib.pyplot as plt fig=plt.figure() #交互式测试,此时报错 解决办法,在引用后添加下面这一行 matplotlib.use('Agg') 例如 import matplotlib matplotlib. 阅读全文
posted @ 2018-04-27 17:04 bioamin 阅读(5263) 评论(0) 推荐(0)
摘要:1..安装Development Tools yum groupinstall -y 'development tools' 2.安装SSL、bz2、zlib来为Python的安装做好准备工作 yum install -y zlib-devel bzip2-devel openssl-devel x 阅读全文
posted @ 2018-04-26 21:12 bioamin 阅读(1666) 评论(0) 推荐(0)