3 Things You Need to Authenticate Users in Django
You want to authenticate users but you’re unsure how. The documentation isn’t the most helpful thing in the world. You think, “wow… this documentation assumes I know all this other stuff…” What are the...
View ArticlePython VS PHP 基础语法
这几天在学习 python ,鄙人平时学习中为了方便记忆和更好的比较与理解语言二者之间在某些情况的优劣性,所以花了点时间,整理了一下 Python 和 php 常用语法的一些区别。 一、大小写 PHP: 所有用户定义的函数、类和关键词(例如 if、else、echo 等等)都对大小写不敏感; 所有变量都对大小写敏感。 Python: 1. 大小写敏感的。 二、变量 PHP: 1....
View ArticlePython之初识 Numpy
python之初识 Numpy 一点号Python热爱者6小时前 本篇讲NumPy系统是Python的一种开源的数值计算扩展。这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structure)结构要高效的多(该结构也可以用来表示矩阵(matrix))。据说NumPy将Python相当于变成一种免费的更强大的MatLab系统。...
View Article大神不会告诉你的Java与Python的区别
大神不会告诉你的Java与python的区别 一点号智游教育2小时前 某同学问小智:“小智小智,学Java好还是学Python好?” 小智跑去问大神(90度鞠躬):“大神,大神,学Java好还是学Python好?” 大神嫌弃的看了我一眼,继续妙手生花的敲代码,良久,飘过来一句:“初学者才争论语言,我们只看心情。” php?url=0FKfSrxClO"...
View ArticlePython爬虫小白入门(一)写在前面
你是不是在为想收集数据而不知道如何收集而着急? 你是不是在为想学习爬虫而找不到一个专门为小白写的教程而烦恼? Bingo! 你没有看错,这就是专门面向小白学习爬虫而写的!我会采用实例的方式,把每个部分都跟实际的例子结合起来帮助小伙伴儿们理解。最后再写几个实战的例子。...
View ArticlePython logging 模块和使用经验
记录下常用的一些东西,每次用总是查文档有点小麻烦。 py2.7 日志应该是生产应用的重要生命线,谁都不应该掉以轻心 有益原则 级别分离 日志系统通常有下面几种级别,看情况是使用 FATAL - 导致程序退出的严重系统级错误,不可恢复,当错误发生时,系统管理员需要立即介入,谨慎使用。 ERROR -...
View ArticleK-nearest neighbor algorithm implementation in Python from scratch
K-nearest-neighbor implementation in python from scratch K-nearest-neighbor algorithm implementation in Python from scratch In the introduction to k-nearest-neighbor algorithm article, we have learned...
View ArticlePython 使用 xlrd/xlwt 读写 Excel 表格
平时经常会遇到处理 Excel 表格数据的情况,人工处理起来实在是太麻烦了,我们可以使用 python 来解决这个问题,我们需要两个 Python 扩展, xlrd 和 xlwt 。 使用 xlwt 写入 Excel 数据 xlwt 的安装方式 $ sudo pip install xlrd Sample import xlwt xls = xlwt.Workbook() sheet =...
View ArticleMoving Average Smoothing for Data Preparation, Feature Engineering, and Time...
Moving average smoothing is a naive and effective technique in time series forecasting. It can be used for data preparation, feature engineering, and even directly for making predictions. In this...
View ArticleDaniel Bader: The Difference Between “is” and “==” in Python
When I was a kid, our neighbors had two twin cats. Both cats looked seemingly identical―same charcoal fur, same piercing green eyes. Some personality quirks aside, you just couldn’t tell them apart...
View ArticleA Look Back and a Peek Ahead: A Year in Review at Anaconda
2016 has been quite the year for all of us at Anaconda! From expanding our strong team to growing our customer and partner rosters and continuing our spirit of innovation, it seems like a perfect time...
View Article一次完整的自动化登录测试-基于python+selenium进行cnblog的自动化登录测试
Web登录测试是很常见的测试!手动测试大家再熟悉不过了,那如何进行自动化登录测试呢!本文作者就用python+selenium结合unittest单元测试框架来进行一次简单但比较完整的cnblog自动化登录测试,给大家提供点参考!下面就包括测试代码和每种测试情况的截图: ''' cnblog的登录测试,分下面几种情况: (1)用户名、密码正确 (2)用户名正确、密码不正确 (3)用户名正确、密码为空...
View Article协程解决递归错误原理
递归是高度抽象化问题的一个好东西,我们能从很多算法书里面看到这个, 但是递归虽然对于人来说好理解,但是计算机执行起来会损失性能,一个差的递归可能会耗光计算机的资源 接下来我们来看一个非常经典的算法问题 Fibonacci数 f(n) = n (n < 2) f(n) = f(n-1) + f(n-2) (n >= 2) 我们可以很轻松的用递归解决掉它 def fibonacci(n):...
View ArticlePython正则表达式re模块简明笔记
简介 正则表达式(regular expression)是可以匹配文本片段的模式。最简单的正则表达式就是普通字符串,可以匹配其自身。比如,正则表达式 ‘hello’ 可以匹配字符串 ‘hello’。 要注意的是,正则表达式并不是一个程序,而是用于处理字符串的一种模式,如果你想用它来处理字符串,就必须使用支持正则表达式的工具,比如 linux 中的 awk, sed, grep,或者编程语言...
View ArticleLinks-Rechts, Links-Rechts, Ahnentafel!
While looking into priority queues and binary heaps, I ran across two gems, one of which may not be so widely known. Consider a complete binary tree with nodes sequentially numbered: You will observe...
View ArticleOpenCV Python program for Vehicle detection in a Video frame
Face Detection Basics The objective of the program given is to detect object of interest(Car) in video frames and to keep tracking the same object. This is an example of how to detect vehicles in...
View Article机器学习caffe环境搭建――redhat7.1和caffe的python接口编译
机器学习caffe环境搭建――redhat7.1和caffe的python接口编译 一点号风起昨天 相信看这篇文章的都知道caffe是干嘛的了,无非就是深度学习、神经网络、计算机视觉、人工智能这些,这个我就不多介绍了,下面说说我的安装过程即遇到的问题,当然还有解决方法。 说下我的环境:1》虚拟机:VM Workstation 12 Player 2》OS:redhat7.1...
View ArticleEssential Libraries for Data Science on a Mac
I recently ran a fresh install on my Mac and thought I’d take the opportunity to document the libraries and programs I find incredibly useful. The python libraries I’ll frequently pip3 install include:...
View Articlepython基础学习笔记2
常见的创建词典的方法: >>>dic = {'tom':11, 'sam':57,'lily':100}>>>print type(dic)与表类似,以逗号分隔每一个元素;每一个元素包含两个部分,键和值;(不可以变的对象可以作为键)。值可以是任意对象;键和值是一一对应; 与表不同的是,词典的元素没有顺序。你不能通过下标引用元素。词典是通过键来引用。...
View ArticlePyCharm - Linux 下最好的 Python IDE
PyCharm - linux 下最好的 python IDE 2小时前来源:Linux中国 介绍 php?url=0FLA5zHGwZ" alt="PyCharm - Linux 下最好的 Python IDE" />在这篇指南中,我将向你介绍一个集成开发环境 - PyCharm, 你可以在它上面使用 Python 编程语言开发专业应用。 Python...
View Article