python
team79
我在努力。
展开
-
为什么要选择Python语言实现机器学习算法
转了回宿舍看:http://www.ituring.com.cn/article/42462 基于以下三个原因,我们选择Python作为实现机器学习算法的编程语言:(1) Python的语法清晰;(2) 易于操作纯文本文件;(3) 使用广泛,存在大量的开发文档。 可执行伪代码 Python具有清晰的语法结构,大家也把它称作可执行伪代码(executable pseudo-code)。默认安装转载 2013-06-04 22:24:54 · 2109 阅读 · 0 评论 -
拷贝Python 对象-----浅拷贝和深拷贝
Python中的对象之间赋值时是按引用传递的,如果需要拷贝对象,需要使用标准库中的copy模块。1、copy.copy 浅拷贝 只拷贝父对象,不会拷贝对象的内部的子对象。2、copy.deepcopy 深拷贝 拷贝对象及其子对象>>> import copy >>> a = [1,2,3,4,['a','b']] #原始对象 >>> b = a #赋值,传对象的引用 >>> c = cop原创 2013-06-04 18:31:43 · 858 阅读 · 0 评论 -
pickle详解
.转载 2017-11-27 10:10:34 · 725 阅读 · 0 评论 -
Python使用网易邮箱发邮件
#! /usr/bin/env python # -*- coding: UTF-8 -*- import smtplib from email.mime.text import MIMETextdef send_mail(sub,content): mailto_list=['*****@163.com'] #收件人(列表) mail_host="smtp.16原创 2017-10-02 00:31:26 · 1972 阅读 · 0 评论 -
python爬队员oj题数
import urllib.request import reclass Hdu: ojname = "http://acm.hdu.edu.cn/userstatus.php?user=" ojmatch = "<tr><td>Problems Solved</td><td align=center>" user = ["hzh0000","syhjh"] user原创 2015-08-17 11:42:07 · 848 阅读 · 0 评论 -
Python-Multiprocessing 多进程学习笔记
The multiprocessing module also introduces APIs which do not have analogs in the threading module. A prime example of this is the Pool object which offers a convenient means of parallelizing the execut原创 2016-11-20 16:59:06 · 841 阅读 · 0 评论 -
Python的函数参数传递
转自:Python的函数参数传递:传值?引用? 对象vs变量在python中,类型属于对象,变量是没有类型的,这正是python的语言特性,也是吸引着很多pythoner的一点。所有的变量都可以理解是内存中一个对象的“引用”,或者,也可以看似c中void*的感觉。所以,希望大家在看到一个python变量的时候,把变量和真正的内存对象分开。类型是属于对象的,而不是变量。 这样,很多问题就容易思考了。例转载 2016-08-01 21:07:58 · 388 阅读 · 0 评论 -
python中的字符串类型内建方法
a.Python1.6 中只适用于Unicode 字符串,2.0 中适用于所有字符串 b. 1.5.2 版本中string 模块没有该方法 c. 在Jython2.1 有 d. 仅对Unicode 字符串有效, e.Python2.5 或者以上版本 string.capitalize() 把字符串的第一个字符大写 string.center(width) 返回一个原字符串原创 2013-07-11 13:14:38 · 951 阅读 · 0 评论 -
一道python题
A=[1,[2,3],[4,5,6],7] B=[2,3,4,5,6,7,8] 想让B的列表结构一样,怎么操作?它们的数量是一样的。 比如:B = [2, [3, 4], [5, 6, 7], 8] model_list = (lambda olst, glst: [ model_list(item, glst) if type(item) is list else glst.pop(...原创 2018-01-31 20:58:32 · 248 阅读 · 0 评论