摘要: class Inventory: def __init__(self): self.slots = [] def add_item(self, item): self.slots.append(item)class ... 阅读全文
posted @ 2017-06-22 22:12 2021年的顺遂平安君 阅读(67) 评论(0) 推荐(0)
摘要: ``` class Inventory: def __init__(self): self.slots = [] def add_item(self, item): self.slots.append(item) class SortedInventory(Inventory): def add_item(self, item): ... 阅读全文
posted @ 2017-06-22 22:12 2021年的顺遂平安君 阅读(203) 评论(0) 推荐(0)
摘要: This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may name an existing attribute or a new 阅读全文
posted @ 2017-06-22 20:10 2021年的顺遂平安君 阅读(234) 评论(0) 推荐(0)
摘要: This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may name an exist... 阅读全文
posted @ 2017-06-22 20:10 2021年的顺遂平安君 阅读(51) 评论(0) 推荐(0)
摘要: def test_var_args(f_arg, *argv): print("first normal arg:", f_arg) for arg in argv: print("another arg through *arg... 阅读全文
posted @ 2017-06-22 20:08 2021年的顺遂平安君 阅读(54) 评论(0) 推荐(0)
摘要: ``` def test_var_args(f_arg, *argv): print("first normal arg:", f_arg) for arg in argv: print("another arg through *argv:", arg) test_var_args('yasoob', 'python', 'eggs', 'test') ``` ... 阅读全文
posted @ 2017-06-22 20:08 2021年的顺遂平安君 阅读(139) 评论(0) 推荐(0)
摘要: ``` if end1 阅读全文
posted @ 2017-06-22 20:01 2021年的顺遂平安君 阅读(3966) 评论(0) 推荐(0)
摘要: if end1 <= val <= end2 or end2 <= val <= end1: return Trueelse: return False 等于 return end1 <= val <= end2 or end2 <= va... 阅读全文
posted @ 2017-06-22 20:01 2021年的顺遂平安君 阅读(107) 评论(0) 推荐(0)
摘要: apt-get install r-base r-base-dev 阅读全文
posted @ 2017-06-22 13:46 2021年的顺遂平安君 阅读(47) 评论(0) 推荐(0)
摘要: ``` apt-get install r-base r-base-dev ``` 阅读全文
posted @ 2017-06-22 13:46 2021年的顺遂平安君 阅读(247) 评论(0) 推荐(0)
摘要: Find the unique elements of an array. Returns the sorted unique elements of an array. There are three optional outputs in addition to the unique eleme 阅读全文
posted @ 2017-06-22 11:27 2021年的顺遂平安君 阅读(467) 评论(0) 推荐(0)
摘要: Find the unique elements of an array. Returns the sorted unique elements of an array. There are three optional outputs in add... 阅读全文
posted @ 2017-06-22 11:27 2021年的顺遂平安君 阅读(74) 评论(0) 推荐(0)
摘要: >>> a = np.arange(6).reshape((3, 2))>>> aarray([[0, 1], [2, 3], [4, 5]]) >>> np.reshape(a, (2, 3)) # C-like index o... 阅读全文
posted @ 2017-06-22 11:22 2021年的顺遂平安君 阅读(71) 评论(0) 推荐(0)
摘要: One shape dimension can be 1. In this case, the value is inferred from the length of the array and remaining dimensions. 阅读全文
posted @ 2017-06-22 11:22 2021年的顺遂平安君 阅读(515) 评论(0) 推荐(0)
摘要: ` Anaconda 安装的时候在 中添加了变量: 阅读全文
posted @ 2017-06-22 11:14 2021年的顺遂平安君 阅读(2050) 评论(0) 推荐(0)
摘要: conda install anaconda-cleananaconda-clean --yes Anaconda 安装的时候在 .bash_profile中添加了变量: export PATH="/Users/jsmith/anaconda3/bin... 阅读全文
posted @ 2017-06-22 11:14 2021年的顺遂平安君 阅读(60) 评论(0) 推荐(0)
摘要: 创建环境 conda create --name bunnies python=3 astroid babel 列出所有环境 conda info --envs 或 conda env list 克隆环境 conda create --nam... 阅读全文
posted @ 2017-06-22 11:12 2021年的顺遂平安君 阅读(47) 评论(0) 推荐(0)
摘要: 创建环境 列出所有环境 或 克隆环境 删除环境 阅读全文
posted @ 2017-06-22 11:12 2021年的顺遂平安君 阅读(202) 评论(0) 推荐(0)
摘要: Plotting numpy arrays as images Colormap 加上 相当于颜色 _reverse_ 。 阅读全文
posted @ 2017-06-22 11:09 2021年的顺遂平安君 阅读(2698) 评论(1) 推荐(0)
摘要: import matplotlib.pyplot as pltplt.imshow(digits.images[-1], cmap = plt.cm.gray_r) .imshow() Plotting numpy arrays as image... 阅读全文
posted @ 2017-06-22 11:09 2021年的顺遂平安君 阅读(82) 评论(0) 推荐(1)