摘要: 方法1方法2方法3改进版本(因为上面的方法只能替换一个符号)方法4两种 translate()方法string下的translate()转变 a > x b > y c > z构建映射表结果上述 table 若为None 说明不做任何的映射 第二个参数 表示 要删除字符串的指定的字符unicode 下的translate()问题三的解决方法Python 字典(Dict... 阅读全文
posted @ 2017-03-31 20:32 keven0526 阅读(3082) 评论(0) 推荐(0) 编辑
摘要: 方法1方法2问题解决方法 阅读全文
posted @ 2017-03-31 19:40 keven0526 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 方法1出现问题资源浪费方法2若字符串中 有数字 可以使用 列表解析 更完美的方法 是 使用生成器 ( ) 阅读全文
posted @ 2017-03-31 10:17 keven0526 阅读(1118) 评论(0) 推荐(0) 编辑
摘要: 方法 正则表达式 捕获组 阅读全文
posted @ 2017-03-30 12:22 keven0526 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 查看权限修改权限 阅读全文
posted @ 2017-03-30 12:06 keven0526 阅读(865) 评论(0) 推荐(0) 编辑
摘要: In [6]: sOut[6]: 'www 1227 0.0 0.0 15572 2096 pts/2 R+ 10:29 0:00 ps aux'In [8]: s.split?Docstring:S.split([sep [,maxsplit]]) -> list of stringsReturn a list of the words in the stri... 阅读全文
posted @ 2017-03-30 11:52 keven0526 阅读(665) 评论(0) 推荐(0) 编辑
摘要: 创建from datetime import datetimeimport pandas as pdimport numpy as np# 指定index为datetime的listdate_list = [datetime(2017, 2, 18), datetime(2017, 2, 19), datetime(2017, 2, 25), datetime(2017... 阅读全文
posted @ 2017-03-17 19:53 keven0526 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: 偏差-方差分解 试图对学习算法的 期望泛化错误率 进行分解。测试样本 x\(y_D\)为 x 在数据集中标记y为x的真实标记f(x;D)为训练集D上学得模型f 在x上的预测输出学习算法的期望预测:偏差 方差 噪声 含义偏差:描述的是预测值(估计值)的期望与真实值之间的差距。偏差越大,越偏离真实数据,如下图第二行所示。方差:描述的是预测值的变化范围,离散程度,也就是离其期望值的距离。方差越大,... 阅读全文
posted @ 2017-03-17 16:02 keven0526 阅读(276) 评论(0) 推荐(0) 编辑
摘要: matplotlib 数据可视化图像中文字体数据集存在的问题#!/usr/bin/env python# -*- coding: utf-8 -*-# Created by xuehz on 2017/3/16import pandas as pdimport matplotlib.pyplot as pltfrom matplotlib import stylestyle.use('ggpl... 阅读全文
posted @ 2017-03-16 23:45 keven0526 阅读(233) 评论(0) 推荐(0) 编辑
摘要: from bokeh.io import output_notebook, output_file, showfrom bokeh.charts import Scatter, Bar, BoxPlot, Chordfrom bokeh.layouts import rowimport seaborn as sns# 导入数据exercise = sns.load_dataset('exer... 阅读全文
posted @ 2017-03-16 19:30 keven0526 阅读(587) 评论(0) 推荐(0) 编辑