#coding:utf-8 from numpy import * def loaddata(): datamat=[] label=[] fr=open("testSet.txt") for line in fr.readlines(): arr=line.strip().split() data... ...
分类:
编程语言 时间:
2017-06-08 23:35:46
阅读次数:
274
1. s.find(t): 字符串s中包含t的第一个索引(没找到返回-1) 2. s.rfind(t): 字符串s中包含t的最后一个索引(没找到返回-1) 3. s.index(t): 与s.find(t)功能类似,但没找到引起ValueError 4. s.rindex(t): 余s.rfind( ...
分类:
其他好文 时间:
2017-06-08 22:36:12
阅读次数:
191
这篇博客是总结、归纳查看Linux系统是32位还是64位的一些方法,很多内容来自网上网友的博客。本篇只是整理、梳理这方面的知识,方便自己忘记的时候随时查看。 方法1:getconf LONG_BIT 查看 如下例子所示: 32位Linux系统显示32, 64位Linux系统显示64。最简单、快捷的方 ...
分类:
系统相关 时间:
2017-06-08 14:56:43
阅读次数:
184
tieba_spider.py: # -*- coding: utf-8 -*- import scrapyimport jsonfrom tieba.items import ThreadItem, PostItem, CommentItemimport helperimport time cla ...
分类:
其他好文 时间:
2017-06-08 14:55:32
阅读次数:
210
WebForm的理解 1、 WebForm概念 ASP.NETWebform提供了一个类似于Winform的事件响应GUI模型(event-drivenGUI),隐藏了HTTP、HTML、JavaScript等细节,将用户界面构建成一个服务器端的树结构控件(Control),每个控件通过ViewSt ...
分类:
Web程序 时间:
2017-06-08 10:37:43
阅读次数:
315
一.数字和字符串类型 1.x.strip:去除两边字符,如(*)默认去除空格 2.x.capitalize:首字母大写 3.x.upper:所有字母大写 4.x.center:居中显示 5.x.count:统计字符串中某个字符的个数 6.x.endswith/ x.startswith:以什么作为结 ...
分类:
其他好文 时间:
2017-06-08 00:18:37
阅读次数:
197
__doc__ 查看尖的描述信息 __module__表示当前操作的对象所在的模块 __class__表示当前操作的对象所属的类 __init__构造方法 通过类创建对象自动执行 __del__析构方法,当前对象在内存中被释放自动斩妖执行 __call__对象后面加括号触发执行 __dict__查看 ...
分类:
编程语言 时间:
2017-06-07 22:22:13
阅读次数:
267
python第二天string 笔记整理 print(1.4e-3) #科学计数法 string方法S strip 去除指定字符,默认为空格 center 剧中显示 count endswith() startwith() find() format() 字符串格式化的 format方法 index ...
分类:
其他好文 时间:
2017-06-07 20:56:04
阅读次数:
265
print('',end=' ')不换行输出 科学计数法print(1.3e3)1300 bin(10)转为二进制oct()八进制hex()十六进制 .strip()掐头去尾.capitalize()首字母大写.upper()所有字母大写.center(30,'*')居中,以*填充,总长30.cou ...
分类:
其他好文 时间:
2017-06-07 20:52:34
阅读次数:
125
一.临时添加UDF函数1.上传jar包至hive服务器2.hiveshell执行如下命令:addjar/home/hive/hivejar/billing-on-hive-1.0.jar
createtemporaryfunctionstripas‘com.tsingzone.bigdata.billing.GetOperator‘;
注:
strip:自定义函数名
com.tsingzone.bigdata.billing.GetOperator..
分类:
其他好文 时间:
2017-06-07 14:13:16
阅读次数:
217