Python
# Python
- Python中if name == ‘main‘:的作用和原理_ (opens new window)
- Python中“if name=='main':”详细解析 - 知乎 (zhihu.com) (opens new window)
- 彻底理解Python中的"指针"_杰克小麻雀的博客-CSDN博客_python有指针吗 (opens new window)
- Python 之 lambda 函数完整详解 & 巧妙运用_Nick Peng的博客-CSDN博客_lambda函数python (opens new window)
- python3排序 sorted(key=lambda)_木子木泗的博客-CSDN博客_python sorted函数key=lambda (opens new window)
- python--.sort(key=lambda x: (-len(x), x), reverse=True)_爱学习的Amelia的博客-CSDN博客_key=lambda x: (opens new window)
- python3排序 sorted(key=lambda)_木子木泗的博客-CSDN博客_python sorted函数key=lambda (opens new window)
- No.3python排序,1.负数在前,整数在后;2.在满足1的条件下要保证偶数在前,奇数在后。_liyuanchao_blog的博客-CSDN博客 (opens new window)
- 【Python位运算】——左移操作(<<)右移操作>>_有情怀的机械男的博客-CSDN博客_python 左移 (opens new window)
- python3中 for 循环中循环变量的作用域问题_阿常呓语的博客-CSDN博客 (opens new window)
树时的问题
- python中对象的基本组成_valives的博客-CSDN博客 (opens new window)
- Python打印对象的全部属性_Ricky的技术小站的博客-CSDN博客_python输出对象所有属性 (opens new window)
a = [i for i in range(5) if i > 2 ]
print(a)
# python中参数列表的形式
a, b
a=1, b=2
*args
**kwargs
a, b=1, *args
空
......
# list中sort方法
cut_dimensions.sort(key=lambda i: \
(-distinct_components_count[i], -distinct_components_ratio[i]))
[476, 94, 1, 21, 5, 0, 11, 33, 0, 0, 0, 0, 0, 1, 13, 25]
0 0
[477, 94, 1, 21, 5, 0, 11, 33, 0, 0, 0, 0, 0, 1, 13, 25]
0 0
[478, 94, 1, 21, 5, 0, 11, 33, 0, 0, 0, 0, 0, 1, 13, 25]
cut_nums== [8, 8]
total_cuts== 64 # 8*8=64
[1, 3] [8, 8] #dim 1 3; cuts: 8 8
[0, 1, 3]
distinct_components_count== [18, 17, 1, 20, 1] distinct_components_ratio== [1.2240012578816128e-08, 2.439231567444466e-06, 1.52587890625e-05, 0.041928721174004195, 1.0]
(-1, -1.0)
2=== [3, 0, 1]
last_mean== 49
cut_nums== [8]
total_cuts== 8
last_mean== 49
cut_nums== [8, 2]
total_cuts== 16
last_mean== 49
cut_nums== [8, 2, 1]
total_cuts== 16
[3, 0] [8, 2]
上次更新: 2022/08/11, 03:44:08