Python教程:进击机器学习(五)--Scipy

Python教程:进击机器学习(五)--Scipy 2017年08月05日 21:22:32 Whytin-Vicky 阅读数:39876 Scipy简介 文件输入和输出scipyio 线性代数操作scipylinalg 快速傅里叶变换scipyfftpack 优化器scipyoptimize 统计工具scipystats Scipy简介 Scipy是一个高级的科学计算库,它和Numpy联系很密切,Scipy一般都是操控Numpy数组来进行科学计算,所以可以说是基于Numpy之上了。Scipy
分类: 编程语言 发布时间: 11-28 22:44 阅读次数: 0

什么是算法?

算法定义 1.一个有限指令集; 2.接受一些输入(有些情况下不需要输入); 3.产生输出; 4.一定在有限步骤之后终止; 5.每一条指令必须 有充分明确的目标,不可以有歧义 计算机能处理的范围之内 描述应不依赖于任何一种计算机语言以及具体的实现手段 什么是好的算法? **空间复杂度S(m)------根据算法写成的程序在执行时占用存储单元的长度。这个长度往往与输入数据的规模有关。空间复杂度过高的算法可能导致使用的内存超限,造成程序非正常中断. **时间复杂度T(n)------根据算法写成的程
分类: 其他 发布时间: 11-28 22:43 阅读次数: 0

20176408李俊 类与对象

抽象 是对具体对象(问题)进行概括,抽出这一类对象的公共性质并加以描述的过程 数据抽象:描述某类对象的属性或状态(对象相互区别的物理量) int Hour , int Minute , int Second 代码抽象:描述某类对象的共有的行为特征或具有的功能 SetTime( ) , ShowTime( ) 抽象的实现:通过类的声明 将抽象出的数据成员、代码成员相结合,将它们视为一个整体。 目的是增强安全性和简化编程,使用者不必了解具体的实现细节,而只需要通过外部接口,以特定的访问权限,来使用
分类: 其他 发布时间: 11-28 22:43 阅读次数: 0

20176408李俊 线性表

线性表 简称表,是n(n≥0)个具有相同类型的数据元素的有限序列。 线性表的长度:线性表中数据元素的个数。 空表:长度等于零的线性表,记为:L=( )。 非空表记为:L=(a1, a2 , …, ai-1, ai , …, an) ai(1≤i≤n)称为数据元素;下角标 i 表示该元素在线性表中的位置或序号 线性表的特性 1.有限性*:线性表中数据元素的个数是有穷的。 2.相同性*:线性表中数据元素的类型是同一的。 3.顺序性*:线性表中相邻的
分类: 其他 发布时间: 11-28 22:43 阅读次数: 0

The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.

在使用直方图时,出现警告 UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been " 意思就是把:normed 换成 density 即可解决问题
分类: 其他 发布时间: 11-28 22:42 阅读次数: 0

随笔--防止忘

df=pd.DataFrame(np.random.randn(1000),index=pd.date_range('20170101',periods=1000),columns=['data']) columns=['data'] 列名 periods=1000 从20170101到1000个数据 df['data'].cumsum() cumsum() 累加 cumprod() 累乘 df.plot(subplots=True,figsize=(18,12)) subplots=T
分类: 其他 发布时间: 11-28 22:42 阅读次数: 0

虚拟环境--

python3 -m venv xxx xxx为虚拟环境的名字
分类: 其他 发布时间: 11-28 22:42 阅读次数: 0

OSError: Initializing from file failed

在你写好数据后,进行保存, 可以允许进行中文保存 file_name='测试.csv' df.to_csv(file_name) 但是在用数据,读取数据的时候 f=(file_name) df_csv=pd.read_csv(f) print(df_csv) OSError: Initializing from file failed 会报错! 意思是不让你用中文 如果就是想用中文,则代码进行: f=open(file_name) df_csv=pd.read_csv(f) print(
分类: 其他 发布时间: 11-28 22:41 阅读次数: 0

groupby

groupby col=col.groupby(['id','money'],as_index=False).sum() 按照id 和 money 这两个特征进行转换新表并自动排序 并对其他列进行sum求和 count等 id money a b 1 1 x y 2 1 xx yy 3 2 x yyy 4 7 xxx y 重新索引 pivot(index='id',columns='money',values='a').reset_index() fillna(0) money
分类: 其他 发布时间: 11-28 22:41 阅读次数: 0

Cache entry deserialization failed, entry ignored

在anaconda上安装 东西 提示 权限不够 用管理员身份打开 Anaconda Prompt 再进行安装
分类: 其他 发布时间: 11-28 22:41 阅读次数: 0

global_variables_initializer

Instructions for updating: Use `tf.global_variables_initializer` instead. initialize_all_variables已被弃用 使用tf.global_variables_initializer代替。 修改下代码就好了
分类: 其他 发布时间: 11-28 22:40 阅读次数: 0

Reshape your data either using array.reshape(-1, 1)

Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample. 版本原因 sklearn 0.19版本 0.18版本一维二维都可以 将代码里所有的一维数组 转化为二维数组就好 通过.reshape(-1, 1) (样本数,目标值) 不知道有多少个样本 但每个样本只有一个目标值
分类: 其他 发布时间: 11-28 22:40 阅读次数: 0

with tf.Session as sess: AttributeError: __exit__

一个小错误 ,不过以后会记住的 with tf.Session as sess: AttributeError: __exit__ 错误原因 在Session后加Session() with tf.Session as sess: 修改成下面就好 with tf.Session() as sess:
分类: 其他 发布时间: 11-28 22:40 阅读次数: 0

ubuntu 安装视频播放器 smplayer

由于 Ubuntu自带的播放器 不能够快进 感觉有点不舒服 所以 安装这个 可以加速播放器 smplayer 打开终端 sudo apt-add-repository ppa:rvm/smplayer sudo apt-get install smplayer sudo apt-get install smplayer-skins sudo apt-get install smplayer-themes 执行完之后,输入 smplayer,启动 基础的 键盘的 [ 减速 ] 加速 其他的 自己
分类: 其他 发布时间: 11-28 22:40 阅读次数: 0

WARNING:tensorflow: Instructions for updating Please use xxxxxxx

是我看得学习 tf 视频有点旧了 还是人家 tf 版本更新太快了 一直给我 红色警告 千奇百怪的 而且不知道怎么解决 很烦 不过找到了一个 很不错的方法 再到入包的下面添加这3句话即可 import tensorflow as tf old_v = tf.logging.get_verbosity() tf.logging.set_verbosity(tf.logging.ERROR) ......中间代码 tf.logging.set_verbosity(old_v)
分类: 其他 发布时间: 11-28 22:39 阅读次数: 0

TypeError: The value of a feed cannot be a tf.Tensor object.

在进行占位符时 遇到这个问题 TypeError: The value of a feed cannot be a tf.Tensor object. Acceptable feed values include Python scalars, strings, lists, numpy ndarrays, or TensorHandles.For reference, the tensor object was Tensor("Cast:0", shape=(1, 5832), dtype=
分类: 其他 发布时间: 11-28 22:39 阅读次数: 0

Key Variable not found in checkpoint [[{{node save/RestoreV2}} = RestoreV2[dtypes=

报错信息: 一堆 挑了几个重要的 tensorflow.python.framework.errors_impl.NotFoundError: Key Variable not found in checkpoint [[{{node save/RestoreV2}} = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0
分类: 其他 发布时间: 11-28 22:39 阅读次数: 0

Ubuntu 安装 Anaconda3

bash Anaconda3-4.2.0-Linux-x86_64.sh 根据相应回车 yes等 完成后打开一个新的命令行窗口 查看是否安装成功 anaconda -V conda -V 启动 ipython notebook 参考链接 https://blog.csdn.net/u012318074/article/details/77074665
分类: 其他 发布时间: 11-28 22:38 阅读次数: 0

linux mysql----You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Mysql 语句毛病 (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nulluser_id varchar(20) not null,foreign key(user_id) references user_surface(us' at line 1") 用
分类: 其他 发布时间: 11-28 22:38 阅读次数: 0

Pyinstaller 打包 py虚拟环境 linux 和 windows

1.打包错误 第一时间 看路径 是否有中文 2.打包后 发现exe 依旧打不开。 考虑是否有依赖图片 直接把代码中所需要的图片 放到与exe同目录下(前提 代码中的图片路径为 当前目录) 安装 pip install pyinstaller 使用 记住 打包之前 1.一定要 自己写的代码 拷贝一份 用拷贝后的代码进行打包 2.代码中 所需要的文件一定放在统一目录下 3.打包所需要的命令行 一定在当前目录下 4.如果 是虚拟环境 则进入虚拟环境 再到要打包的目录下 在进行打包 pyinstall
分类: 其他 发布时间: 11-28 22:38 阅读次数: 0