随笔分类 -  python

上一页 1 ··· 6 7 8 9 10 11 12 下一页
摘要:9. 类 — Python 3.11.3 文档 https://docs.python.org/zh-cn/3/tutorial/classes.html class DerivedClassName(modname.BaseClassName): 派生类定义的执行过程与基类相同。 当构造类对象时, 阅读全文
posted @ 2017-12-01 08:24 papering 阅读(586) 评论(0) 推荐(0)
摘要:merge two dicts Python 3.6.4 >>> x={'a':1,'b':2}>>> y={'b':3,'c':4}>>> z={**x,**y}>>> z{'a': 1, 'b': 3, 'c': 4}>>> z={**y,**x}>>> z{'b': 2, 'c': 4, 'a 阅读全文
posted @ 2017-11-30 14:15 papering 阅读(204) 评论(0) 推荐(0)
摘要:https://bugs.python.org/issue2898 https://bugs.python.org/file10353/footprint.patch A new function, getsizeof(), takes a Python object and returns the 阅读全文
posted @ 2017-11-25 11:34 papering 阅读(315) 评论(0) 推荐(0)
摘要:decorator Glossary — Python 3.6.3 documentation https://docs.python.org/3/glossary.html decorator A function returning another function, usually appli 阅读全文
posted @ 2017-11-25 09:57 papering 阅读(217) 评论(0) 推荐(0)
摘要:原因:学python的时候,把centos7自带的python2.7改成了python3.6.2。而yum使用的是python2,所以会出现yum报错。 解决方法: 在文件/usr/bin/yum、/usr/libexec/urlgrabber-ext-down最上面的一行改为#!/usr/bin/ 阅读全文
posted @ 2017-11-23 20:27 papering 阅读(764) 评论(0) 推荐(0)
摘要:jupyter notebook 阅读全文
posted @ 2017-11-22 19:05 papering 阅读(153) 评论(0) 推荐(0)
摘要:l=[1,2,3]def f(l): l[1]=123print(l)f(l)print(l)s="abc"def f1(s): s="x"print(s)f1(s)print(s) 可变对象 浅复制,函数修改了原值 不可变对象,不影响 对于不可变类型(数值型、字符串、元组),因变量不能修改,所以运 阅读全文
posted @ 2017-11-16 10:52 papering 阅读(328) 评论(0) 推荐(0)
摘要:class Student():... name = 'Student'...s = Student() # 创建实例sprint(s.name) # 打印name属性,因为实例并没有name属性,所以会继续查找class的name属性Studentprint(Student.name) # 打印类 阅读全文
posted @ 2017-11-15 09:51 papering 阅读(203) 评论(0) 推荐(0)
摘要:for i in range(3, -2, -1): try: print(4 / i) except Exception as e: print(Exception) print(e) 阅读全文
posted @ 2017-10-25 14:36 papering 阅读(144) 评论(0) 推荐(0)
摘要:7.13. nonlocal 语句 nonlocal_stmt ::= "nonlocal" identifier ("," identifier)* nonlocal 语句会使得所列出的名称指向之前在最近的包含作用域中绑定的除全局变量以外的变量。 这种功能很重要,因为绑定的默认行为是先搜索局部命名 阅读全文
posted @ 2017-10-18 20:05 papering 阅读(122) 评论(0) 推荐(0)
摘要:对于线性方程组Ax=b 对A和b执行同样的一串行初等运算, 那么该方程组的解集不发生变化。 【未知-已知 高阶--低阶】 http://mathworld.wolfram.com/CramersRule.html 阅读全文
posted @ 2017-10-16 14:54 papering 阅读(358) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-10-12 03:01 papering 阅读(157) 评论(0) 推荐(0)
摘要:Frequently Asked Questions — PyPy documentation https://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why PEP 703 – Making the Global Interpret 阅读全文
posted @ 2017-10-10 00:42 papering 阅读(235) 评论(0) 推荐(0)
摘要:every row of W is a classifier for one of the classes As we saw above, every row of W is a classifier for one of the classes. The geometric interpreta 阅读全文
posted @ 2017-09-26 16:18 papering 阅读(204) 评论(0) 推荐(0)
摘要:安装TensorFlow 包依赖 https://www.tensorflow.org/tutorials/layers Building the CNN MNIST Classifier 【Each of these methods accepts a tensor as input and re 阅读全文
posted @ 2017-09-19 18:10 papering 阅读(503) 评论(0) 推荐(0)
摘要:https://raw.githubusercontent.com/tensorflow/tensorflow/r1.3/tensorflow/examples/tutorials/word2vec/word2vec_basic.py 阅读全文
posted @ 2017-09-18 20:08 papering 阅读(327) 评论(0) 推荐(0)
摘要:json.dumps(i['bd_res'], ensure_ascii=False) import xlrd import time import sys import os import requests import sqlite3 import threading import math import csv import pprint import json from openpy... 阅读全文
posted @ 2017-09-09 15:17 papering 阅读(575) 评论(0) 推荐(0)
摘要:def gen_file_data(fodir, fname, sheet_index=0, ): if fname.find('.xlsx') > -1: fname_open = '%s\\%s' % (fodir, fname) book = xlrd.open_workbook(fname_open, on_demand=True... 阅读全文
posted @ 2017-09-09 14:10 papering 阅读(188) 评论(0) 推荐(0)
摘要:time — Time access and conversions — Python 3.8.5 documentation https://docs.python.org/3/library/time.html#time.monotonic PEP 418 -- Add monotonic ti 阅读全文
posted @ 2017-08-25 21:06 papering 阅读(705) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 下一页