这两天对Python进行了研究,并且配置了numpy、matplotlib以及scipy。现对基本概念以及配置步骤介绍:
基本概念:
Python
(英语发音:/?pa?θ?n/),
是一种面向对象、解释型计算机程序设计语言。专用的科学计算扩展库很多,例如如下3个十分经典的科学计算扩展库:NumPy、SciPy和matplotlib,它们分别为Python提供了快速数组处理、数...
分类:
编程语言 时间:
2014-06-09 23:17:32
阅读次数:
429
下面说说split函数的用法
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')#split('.',1) use '.' split one time
return words
def sort_words(wo...
分类:
编程语言 时间:
2014-06-08 18:19:21
阅读次数:
336
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-06-08 16:27:47
阅读次数:
231
先上写干货,几个开源网站:
github.com
launchpad.netgitorious.orgsourceforge.netfreecode.com
今天介绍一下python函数和文件读写的知识。
函数
def print_two(*args):#That tells Python to take all the arguments to the function a...
分类:
编程语言 时间:
2014-06-08 10:37:23
阅读次数:
277
谁说字符串不可变?string s =
"abc";s="123",s这不是变了吗?要区分变量名和变量指向的值的区别:程序中可以有很多字符串,然后由字符串变量指向他们,变量也可以指向其他的字符串,但是字符串本身没有变化。字符串不可变性指的是内存中的字符串不可变,而不是变量不变。1
//...
分类:
其他好文 时间:
2014-06-07 22:05:14
阅读次数:
195
操纵类的属性,有两种方法反射内省面向对象的编程中,对于用户提交过来的数据,要封装成一个javaBean,也就是对象其中Bean的属性不是由字段来决定的,而是由get和Set方法来决定的public
class Person { private String name ; private ...
分类:
编程语言 时间:
2014-06-07 21:26:41
阅读次数:
396
在iOS中可变字典增加一个键值对的方法有setObject: forKey:
和setValue : forKey:
.为了方便我们把这两个方法简称为方法A和方法B。B这个方法中其中的value值是不能为nil,否则程序会出项崩溃。而A方法中的这个value可以为nil,但是当这个value位nil...
分类:
其他好文 时间:
2014-06-07 21:24:08
阅读次数:
241
/** * 获得连续子数组的最大和 * * @author dfeng * */ private
static long getMax(long a, long b) { return a > b ? a : b; } /** *
获得连续子数组的最大和 * * @param array ...
分类:
其他好文 时间:
2014-06-07 21:21:30
阅读次数:
241
问题: ASP.NET Configuration
site->安全,报错“选定的数据存储区出现问题,原因可能是服务器名称或凭据无效,或者权限不足”解决:打开文件C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config找到...
分类:
其他好文 时间:
2014-06-07 21:14:32
阅读次数:
279
/** * 最大子数组的暴力求解算法,复杂度为o(n2) * @param n * @return
*/ static MaxSubarray findMaxSubarraySlower(int[] n) { long tempSum = 0; int
left = 0; int right = 0...
分类:
其他好文 时间:
2014-06-07 21:07:50
阅读次数:
250