1.NLTK的概念 NLTK:Natural language toolkit,是一套基于python的自然语言处理工具. 2.NLTK中集成了语料与模型等的包管理器,通过在python编辑器中执行. import nltk nltk.download() 便会弹出下面的包管理界面,在管理器中可以下载语料,预训练的模型等. 比如下载完语料库(比方说是gutenberg语料库),可以通过以下加载: fileids()函数可以查看gutenberg中收录的图书,words函数可以方便地得到某本书中文…
Edited by Markdown Refered from: John Ladd, Jessica Otis, Christopher N. Warren, and Scott Weingart, "Exploring and Analyzing Network Data with Python," The Programming Historian 6 (2017), https://programminghistorian.org/en/lessons/exploring-an…
一.socket提升 1.熟悉socket.socket()中的省略部分 socket.socket(AF.INET,socket.SOCK_STREAM) 2.send与recv发送大文件时对于黏包的处理. 2.1 sendall的发送方式与for i in f(局部) 2.2 使用send.recv交替的方式做一个ack来解决黏包 3.socketserver多并发处理 3.1  5种不同的socket类 3.1.1 baseserver用于继承,不对外提供服务 3.1.2 tcpserve…
python内置封装了很多常见的网络协议的库,因此python成为了一个强大的网络编程工具,这里是对python的网络方面编程的一个简单描述. urllib 和 urllib2模块 urllib 和urllib2是python标准库中最强的网络工作库.这里简单介绍下urllib模块.本次主要用urllib模块中的常用的几个模块: urlopen parse urlencode quote unquote _safe_quoters unquote_plus GET请求: 使用urllib 进行h…
今日内容 参数 作用域 函数嵌套 知识点回顾 函数基本结果 def func(name,age,email): # 函数体(保持缩进一致) a = 123 print(a) return 1111#函数中,出现return后,后面的语句不再执行. b = 456 print(b) result = func(1,2,3) # 函数默认返回值:None 参数 def func(n1,n2): print(n1,n2) func(1,2) func(1,[11,22,3]) func({'k1':'…
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 我们多添加一些测试场景,比如:删除邮件,查找邮件,发送邮件等等 """ import unittest import os import sys from selenium import webdriver cur_dir = os.getcwd() sys.path.append(cur_dir.split(r'\test_case')[0])…
1. MapReduce(并行处理的框架) 思想:分而治之,一个大任务分解成多个小的子任务(map),并行执行后,合并结果(Reduce) (1)大任务分解成多个小任务,这个过程就是map: (2)多个小任务结果的合并,这个过程就是Reduce: 2.通过一个案例说明MapReduce思想如下:       一副牌(不含大小王)有52张,共有1000副牌,也就是说应该有52000张扑克牌,但是如果其中少了1张,也就是变成了51999张扑克牌,如下: 现在少了1张牌,我们想把它找出来,该怎么办呢?…
Undo自动管理与手动管理 undo段自动管理SQL> show parameter undo_management 将undo段改为手工管理SQL> alter system set undo_management=manual scope=spfile;SQL> startup force; SQL> show parameter undoSQL> select * from v$rollname; SQL> create undo tablespace undot…
本程序 (1)mnist的图片转换成TFrecords格式 (2) 读取TFrecords格式 # coding:utf-8 # 将MNIST输入数据转化为TFRecord的格式 # http://blog.csdn.net/u014182497/article/details/74376224 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np…
1.Build a histogram In [1]: help(plt.hist) Help on function hist in module matplotlib.pyplot: hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, lo…