摘要:
DataFrame is 2-D array, Series is 1-D array 例子1: democrat = (gss['partyid'] <= 1) gss is a DataFrame from CSV, gss['partyid']取出gss这一列,而DataFrame的每一列都是 阅读全文
摘要:
在re这一模块的官方文档的解释如下 Regular expressions use the backslash character ('') to indicate special forms or to allow special characters to be used without inv 阅读全文
摘要:
为何什么用字典保存计算结果而不是列表? 使用字典的优势: 不必像使用列表一样提前分配内存 在字典中存入0,1对应的斐波那契数之后不必对0,1特殊处理 某个数是否算过的判断方式比列表更优雅 点击查看代码 class Solution: def fib_help(self, n, nb): if n < 阅读全文
摘要:
Reference in fact store address of object, but has different syntax and feature ①We don’t need to worry null pointer dereferencing because there is no 阅读全文
摘要:
(1)Base case 和recursive case 返回相同的类型 or 有相同的side effect(eg. Mutate a tree) (2)画好图(比如一个tree), then从base case 和它的上一层思考问题,如果你的code能从最底层和倒数第二层运行成功,那么依据递归规 阅读全文