Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Browsing all 9596 articles
Browse latest View live

PyPy Development: PyPy Tooling Upgrade: JitViewer and VMProf

We are happy to announce a major JitViewer (JV) update. JV allows you to inspect Rpython's internal compiler representation (the language in which PyPy is implemented) including the generated machine...

View Article


Image may be NSFW.
Clik here to view.

scrapy爬虫学习【五】综合

一、简介 Scrapy,python开发的一个快速,高层次的屏幕抓取和web抓取框架,用于抓取web站点并从页面中提取结构化的数据。Scrapy用途广泛,可以用于数据挖掘、监测和自动化测试。 Scrapy吸引人的地方在于它是一个框架,任何人都可以根据需求方便的修改。它也提供了多种类型爬虫的基类,如BaseSpider、sitemap爬虫等,最新版本又提供了web2.0爬虫的支持。 1.1 框架介绍...

View Article


scrapy爬虫学习【四】之下载中间件的使用

写在前面 下载器中间件是什么? 是用于全局修改Scrapy request和response的一个轻量、底层的系统。 举个例子, 当需要挂代理访问某个网站 、 需要修改爬虫的User-Agent 、 或者需要带cookie访问某个网站的时候 ,下载器中间件的使用就成为了必要! 中间件的使用 激活下载器中间件 要激活下载器中间件组件,需将其加入到 DOWNLOADER_MIDDLEWARES...

View Article

Image may be NSFW.
Clik here to view.

Import Python: ImportPython Issue 85

Worthy Read python has come a long way. So has job hunting. Get in front of 4,000+ companies with one application. No more pushy recruiters, no more dead end applications and mismatched companies....

View Article

Think Python : 3.5 添加新函数

目前为止,我们只是在使用python提供的函数,但添加新函数也是有可能的。 函数定义 详细说明了一个新函数的名称和当函数被调用时将运行的一系列语句。 这是一个例子: def print_lyrics(): print "I'm a lumberjack, and I'm okay." print "I sleep all night and I work all day."...

View Article


Image may be NSFW.
Clik here to view.

ciso8601 vs mxDateTime vs udatetime

In my last performance comparison I compared libraries with non performance goals with datetime and udatetime, to illustrate the impact of your library choice. Arrow, Pendulum and Delorean are awesome...

View Article

Image may be NSFW.
Clik here to view.

Troubleshooting Containers

Introduction I find my self rather often than not in a situation where I have to trouble shoot a containerized application or a coworker needs some help doing so. In this post I want to show some...

View Article

Image may be NSFW.
Clik here to view.

用交叉验证改善模型的预测表现(适用于Python和R)

用交叉验证改善模型的预测表现(适用于python和R) 一点号数据玩家昨天 限时干货下载: 回复【2】免费获取【超全数据分析资料免费下载(包含SQL,R语言,SPSS,SAS,python,数据挖掘)!】 我一直对数据界的编程马拉松(Hackathons)保持关注。通过对比排名榜初期和最终的结果, 我发现了一个有趣的现象:在初期排名较高的参赛者,在最终的验证环节往往地位不保,有些甚至跌出前 20...

View Article


Image may be NSFW.
Clik here to view.

如何用Python 制作 GIF 动图?

如何用python 制作 GIF 动图? 一点号编程派昨天 今天分享的这篇译文中介绍了 matplotlib 绘图库的一个 使用示例,即如何制作 GIF 动图。本文原作者为Eli Bendersky,译者为唐晓霆 Jason,由编程派EarlGrey校对。 译者简介:唐晓霆,在香港的成都人,城市大学研究助理,会写python,兴趣是深度学习。 这篇短文介绍如何用 Python 里的...

View Article


Package of the Week: django-import-export

As the name suggests, this is a library to handle importing and exporting data. The django-import-export library supports multiple formats, including xls , csv , json , yaml , and all other formats...

View Article

Image may be NSFW.
Clik here to view.

Eclipse配置Python环境

提示 Project interpreter not specified 尝试点击 Please configure an interpreter before proceeding (请在运行前配置一个解释器) 弹出一个对话框 有三个按钮 Quick Auto-Config 这个会自动搜索并配置Advanced Auto-Config 高级自动配置manual config 手动配置 我点的第一个...

View Article

Django 1.10提供了PostgreSQL中的全文检索功能

Django 1.10版本已经发布,该版本所给出的新特性包括:对PostgreSQL数据库的全文检索、Unicode用户名的官方支持和新型的中间件。 作为Django软件基金会的动态语言,该Django的重大发布包括了在django.contrib.postgres.search模块中对数据库函数调用的功能,这方便了使用PostgreSQL的全文检索引擎。 Django团队给出了 例子代码...

View Article

Python rant: ‘ from foo import * ‘ is bad

This is my rant on import *. There are many like it , but this one is mine. I tend to work with scientists so I’ll use something from mathematics as my example. What is the result of executing the...

View Article


Testing OpenStack with always updating python package versions

With any software package, you will need additional packages to run it. Often, there's a tight coupling: The software package will only run with specific other package versions. This dependency...

View Article

Instawork (YC S15) is hiring Back end/Fullstack/Mobile devs for local...

Instawork is the fastest growing marketplace for local jobs. We've changed the way traditional job search works for small businesses (e.g a sign on the window) by turning the process into an automated...

View Article


python下以api形式调用tesseract识别图片验证码

一、背景 之前在博文中介绍在python中如何调用tesseract ocr引擎,当时主要介绍了shell模式,shell模式需要安装tesseract程序,并且效率相对略低。 今天介绍api形式的调用方式,因为博主主要是基于windows环境进行开发,所以这里的api调用主要是指dll调用(linux之类是.so调用) 二、tesseract dll下载网址...

View Article

python运维开发之第三天

一、第二天课程的复习总结 1、列表可以增删改查,元组是不可修改的列表,字符串是不可以修改的。 2、列表,元组是有序的,字典是无序的,字典的key唯一 3、列表字典可以嵌套列表,可以嵌套字典,可以嵌套多层 4、字典不需要保存下标,是通过key来找值(value) 二、集合 1、集合特点:无序,不可重复,关系测试 2、关系测试 a、交集:取出两个集合间的重复部分A.intersection.B...

View Article


Image may be NSFW.
Clik here to view.

Python面试题 ―― 获取列表中位数

中位数是一个可将数值集合划分为相等的上下两部分的一个数值。如果列表数据的个数是奇数,则列表中间那个数据就是列表数据的中位数;如果列表数据的个数是偶数,则列表中间那2个数据的算术平均值就是列表数据的中位数。在这个任务里,你将得到一个含有自然数的非空数组(X)。你必须把它分成上下两部分,找到中位数。 输入: 一个作为数组的整数(int)列表(list)的。 输出: 数组的中位数(int, float)....

View Article

Image may be NSFW.
Clik here to view.

scrapy_redis 和 docker 实现简单分布式爬虫

简介 在使用 scrapy 爬取 IT桔子公司 信息,用来进行分析,了解 IT 创业公司的一切情况,之前使用 scrapy 写了一个默认线程是10的单个实例,为了防止被 ban IP 设置了下载的速度,3万多个公司信息爬了1天多才完成,现在想到使用分布式爬虫来提高效率。 技术工具: python3.5 scrapy scrapy_redis redis docker1.12...

View Article

Image may be NSFW.
Clik here to view.

利用 Python 进行数据分析(十二)pandas:数据合并

pandas 提供了三种主要方法可以对数据进行合并: pandas.merge()方法:数据库风格的合并; pandas.concat()方法:轴向连接,即沿着一条轴将多个对象堆叠到一起; 实例方法combine_first()方法:合并重叠数据。 pandas.merge()方法:数据库风格的合并 例如,通过merge()方法将两个DataFrame合并:...

View Article
Browsing all 9596 articles
Browse latest View live