python学习
理想主义文艺青年
理想主义源于对生活的憧憬 文艺是对生活的态度
展开
-
pythpn学习の爬虫爬取糗事百科热门段子
根据别人写的教程学习的 由于现在糗事百科那个代码进行了修改 原来使用的正则表达式不适用了自己重新写的正则表达式 可以爬取热门段子的作者 内容 发布时间 赞数 #__author youngkl # -*- coding:utf-8 -*- import urllib import urllib2 import re page = 1 url = 'http://www.qiushib原创 2015-07-30 02:41:54 · 1109 阅读 · 2 评论 -
python爬虫 爬取淘女郎介绍以及照片
从https://mm.taobao.com/json/request_top_list.htm?page=1上爬取淘女郎的介绍和个人主页的照片 Spider.py # __author__ = 'youngkl' #_*_ coding:utf-8 _*_ import urllib import urllib2 import re import tool import os原创 2015-08-02 01:59:38 · 4926 阅读 · 6 评论 -
python 识别验证码
具体学习可去这个网址:点击打开链接 # __author__ = 'youngkl' # -*- coding: utf-8 -*- from PIL import Image import hashlib import time import os import math class VectorCompare: def magnitude(self,concordance):原创 2016-09-20 16:48:54 · 885 阅读 · 0 评论 -
python将图片转换为字符画
写代码之前需要安装pillow库 至于如何安装可以百度 原文链接 原文是需要通过命令行运行程序 当然也是可以的 我改为直接运行了 需要固定一些参数 当然 也可以设置变量 从控制台输入 #__author__ = 'youngkl' #-*- coding:utf-8 -*- from PIL import Image # import argparse # # #命令行参数处理 # p原创 2016-09-12 19:56:28 · 2491 阅读 · 0 评论 -
python 将文字转为图片Logo
将中文填充颜色 并在图片中呈现 # __author__ = 'youngkl' # -*- coding: utf-8 -*- from PIL import Image,ImageDraw,ImageFont from _ctypes import sizeof import ConfigParser import struct from random import randint fro原创 2016-09-29 15:11:17 · 4010 阅读 · 0 评论 -
python学习 小记
写机器学习算法 经常用到python 这里记录一些常用的python小的点 会很基础 供个人使用 贴出来一些自己学的过程中 写的小的测试代码 1.矩阵定义 矩阵的转置 矩阵的逆 矩阵相乘 e的N次方 import numpy as np a=np.mat('1 1 1 1;0.1353 0.3678 0.3678 1;1 0.3678 0.3678 0.1353') # c=np原创 2017-04-01 14:03:19 · 347 阅读 · 0 评论 -
TensorFlow基本用法
# __author__ = 'youngkl' # -*- coding: utf-8 -*- import tensorflow as tf #1*2的矩阵 mat1=tf.constant([[3.,3.]]) #2*1的矩阵 mat2=tf.constant([[2.],[3.]]) ans=tf.matmul(mat1,mat2)#此时ans无法直接输出 ''' # 启动默认图原创 2017-04-10 20:53:25 · 481 阅读 · 0 评论 -
TensorFlow-MNIST入门篇代码
看了下TensorFlow的官方文档 里面关于MNIST的入门篇 在这里把代码整理了 input_data.py(urllib下面有红线 没关系) # __author__ = 'youngkl' # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division fr原创 2017-04-11 15:39:19 · 985 阅读 · 0 评论 -
TensorFlow-MNSIT进阶篇代码
在入门篇之后 进阶篇进行了拓展 使用了卷积神经网络 两个卷积层 两个pooling层 一个全连接层 其中注意 padding='SAME'对图片大小的影响 For the SAME padding, the output height and width are computed as: out_height = ceil(float(in_height) / f原创 2017-04-11 20:51:34 · 720 阅读 · 0 评论