会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
机器狗mo
博客园
首页
新随笔
联系
管理
上一页
1
···
7
8
9
10
11
12
13
14
15
···
19
下一页
2020年6月10日
全排列和全组合
摘要: def combinations(arr,num): def solver(arr,num,ans,cur,s): print(s,'cur',cur) if len(cur)==num: ans.append(cur[::]) return for i in range(s,len(arr)):
阅读全文
posted @ 2020-06-10 15:45 机器狗mo
阅读(128)
评论(0)
推荐(0)
2019年12月16日
python 检查数据类型
摘要: ##检查数据为空(nan) import math x=float('nan') math.isnan(x) ## 检查 def typeof(variate): type=None if isinstance(variate,int): type = "int" elif isinstance(v
阅读全文
posted @ 2019-12-16 13:32 机器狗mo
阅读(91)
评论(0)
推荐(0)
2019年12月6日
python pool 进程池
摘要: 平常会经常用到多进程,可以用进程池pool来进行自动控制进程,下面介绍一下pool的简单使用。 需要注意的是,在Windows上要想使用进程模块,就必须把有关进程的代码写if name == ‘main’ :语句的下面,才能正常使用Windows下的进程模块。Unix/Linux下则不需要。 Poo
阅读全文
posted @ 2019-12-06 12:12 机器狗mo
阅读(405)
评论(0)
推荐(0)
2019年12月2日
pandas merge 性能优化
摘要: Set your merge columns as index, and use df1.join(df2) instead https://stackoverflow.com/questions/40860457/improve-pandas-merge-performance
阅读全文
posted @ 2019-12-02 15:24 机器狗mo
阅读(1015)
评论(0)
推荐(0)
2019年10月29日
hadoop streaming map输入文件路径获取
摘要: ## 判断输入文件 import os import sys for line in sys.stdin: map_input_file = os.environ.get("map_input_file") if path in map_input_file: # do sth
阅读全文
posted @ 2019-10-29 16:56 机器狗mo
阅读(347)
评论(0)
推荐(0)
2019年10月28日
LeetCode 4. 寻找两个正序数组的中位数
摘要: 给定两个大小为 m 和 n 的正序(从小到大)数组 nums1 和 nums2。请你找出并返回这两个正序数组的中位数。 进阶:你能设计一个时间复杂度为 O(log (m+n)) 的算法解决此问题吗? 示例 1: 输入:nums1 = [1,3], nums2 = [2] 输出:2.00000 解释:
阅读全文
posted @ 2019-10-28 23:19 机器狗mo
阅读(53)
评论(0)
推荐(0)
2019年10月27日
剑指 Offer 56 - I. 数组中数字出现的次数
摘要: https://www.cnblogs.com/sandy-t/p/13198746.html
阅读全文
posted @ 2019-10-27 16:31 机器狗mo
阅读(88)
评论(0)
推荐(0)
LeetCode 260.只出现一次的数字 III
摘要: 给定一个整数数组 nums,其中恰好有两个元素只出现一次,其余所有元素均出现两次。 找出只出现一次的那两个元素。 示例 : 输入: [1,2,1,3,2,5] 输出: [3,5] 注意: 1、结果输出的顺序并不重要,对于上面的例子, [5, 3] 也是正确答案。 2、你的算法应该具有线性时间复杂度。
阅读全文
posted @ 2019-10-27 16:30 机器狗mo
阅读(88)
评论(0)
推荐(0)
2019年10月14日
xgboost load model from demp text file
摘要: python package : https://github.com/mwburke/xgboost python deploy pred1 pred2 diff 33243 0.515672 0.515672 1.635301e 08 15742 0.478694 0.478694 3.4686
阅读全文
posted @ 2019-10-14 17:15 机器狗mo
阅读(929)
评论(0)
推荐(0)
2019年9月26日
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
摘要: https://www.cnblogs.com/sandy-t/p/13195558.html
阅读全文
posted @ 2019-09-26 17:14 机器狗mo
阅读(88)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
15
···
19
下一页
公告