随笔分类 - Python学习
Python小白的学习笔记,心路历程。
摘要:Python中数字转化为字符串 报错的写法 ### 这样直接转换会报错 num_te = 88888 print(str(num_te)) # 错误信息 # TypeError: 'str' object is not callable 修改后的写法 num_te = 88888 print('%d
阅读全文
摘要:np.meshgrid np.c_[xx.ravel(), yy.ravel()] 代码 xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.02), np.arange(y_min, y_max, 0.02) ) predict = clf.predict
阅读全文
摘要:统计一个数字在排序数组中出现的次数。 示例 1: 输入: nums = [5,7,7,8,8,10], target = 8 输出: 2 示例2: 输入: nums = [5,7,7,8,8,10], target = 6 输出: 0 思路: 遍历列表,遇到与target的值相等的数时,计数器加一,
阅读全文

浙公网安备 33010602011771号