V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  EmdeBoas  ›  全部回复第 9 页 / 共 10 页
回复总数  188
1  2  3  4  5  6  7  8  9  10  
2017-05-30 21:36:52 +08:00
回复了 tianxiacangshen 创建的主题 PHP 有没有人怀疑过 rand()函数得到的随机数并不随机?
随机也是有分布的,numpy 里面有各种各样分布的随机函数,按需求去用咯
2017-05-28 09:19:39 +08:00
回复了 jiqing 创建的主题 职场话题 高中同学培训了半年前端现在北京 10K
@coderluan 去年的批发价是 1w2 起~听说是不想当备胎了 hhhhhhh
2017-05-24 10:45:11 +08:00
回复了 jztan1996 创建的主题 求职 大三一年半前端经验,求带走
群主在这里竟然看到你了 hhhhhhhh,顶一顶(ง •̀_•́)ง
2017-05-22 08:48:13 +08:00
回复了 guolingbing 创建的主题 Python 问一个 numpy pandas 相关的问题
不直接选取可以考虑这样做:用一个乘数 hash 把 a 映射到一个 set 里面,比如 hash(x)=3x[0]+33x[1]+333x[2],然后去同样遍历 b,放不进 set 就说明存在了,按 index 去掉就好了,复杂度是 n,不过这样做 hash.函数选的不好可能就会误报……直接选取的想法也有,不过现在手边没电脑没法验证……中午回去了试试
不要提前优化...一边写一遍想着优化那样项目没法写下去的,用 web 有很多现成的轮子 美观又易用
2017-05-18 15:30:36 +08:00
回复了 iVeego 创建的主题 Python 请教一个多组数据点拟合的问题,需要用 Python 实现。
额 神经网络+1
2017-05-14 00:01:40 +08:00
回复了 kingmo888 创建的主题 Python 这一行 Python 代码,如何更快的提高运算速度?
@kingmo888 (⊙﹏⊙)....我不是做 python 的( python 的并行库我都没用过) 只是做数模比赛做多了对 numpy 和 pandas 熟悉一点.... java 的 hadoop 我可能还能帮你看看...
2017-05-13 23:59:51 +08:00
回复了 kingmo888 创建的主题 Python 这一行 Python 代码,如何更快的提高运算速度?
老哥 你别老复杂化问题啊.....loc 和 iloc 要少用 效率很低的
In [17]: def test():
...: array = []
...: other = []
...: for i in xrange(1000000):
...: [TAB]other.append(i)
...: [TAB]year = np.random.randint(100) + 2000
...: [TAB]month = np.random.randint(12) + 1
...: [TAB]day = np.random.randint(28) + 1
...: [TAB]array.append(datetime.datetime(year, month, day))
...: narray = np.array(array)
...: flag = datetime.datetime(2015, 5, 3)
...: df = pd.DataFrame()
...: df['date'] = narray
...: df['other'] = other
...: print df[narray[:]<=flag][-5:]
...:

In [18]: %timeit test()
date other
999979 2006-07-05 999979
999980 2012-09-19 999980
999981 2010-05-13 999981
999990 2007-10-14 999990
999996 2008-10-19 999996
date other
999979 2002-08-01 999979
999983 2001-10-01 999983
999984 2007-04-05 999984
999988 2014-04-21 999988
999991 2008-01-06 999991
date other
999977 2004-05-04 999977
999981 2004-05-05 999981
999990 2003-10-04 999990
999991 2003-03-28 999991
999992 2002-12-09 999992
date other
999964 2006-12-13 999964
999970 2012-07-07 999970
999971 2009-12-15 999971
999976 2004-07-22 999976
999982 2009-11-14 999982
1 loop, best of 3: 4.58 s per loop

In [19]:
2017-05-13 23:34:49 +08:00
回复了 kingmo888 创建的主题 Python 这一行 Python 代码,如何更快的提高运算速度?
...我把数据量调到了 100W 然后试的
In [8]: def test():
...: array = []
...: for i in xrange(1000000):
...: year = np.random.randint(100) + 2000
...: month = np.random.randint(12) + 1
...: day = np.random.randint(28) + 1
...: array.append(datetime.datetime(year, month, day))
...: narray = np.array(array)
...: flag = datetime.datetime(2015, 5, 3)
...: print narray[narray[:]<=flag][-5:]
...:

In [9]: %timeit test()
[datetime.datetime(2012, 12, 11, 0, 0) datetime.datetime(2009, 5, 26, 0, 0)
datetime.datetime(2014, 6, 12, 0, 0) datetime.datetime(2008, 11, 23, 0, 0)
datetime.datetime(2010, 12, 12, 0, 0)]
[datetime.datetime(2009, 4, 8, 0, 0) datetime.datetime(2013, 2, 10, 0, 0)
datetime.datetime(2008, 2, 4, 0, 0) datetime.datetime(2010, 11, 2, 0, 0)
datetime.datetime(2005, 8, 27, 0, 0)]
[datetime.datetime(2004, 6, 19, 0, 0) datetime.datetime(2010, 5, 7, 0, 0)
datetime.datetime(2012, 5, 15, 0, 0) datetime.datetime(2012, 6, 7, 0, 0)
datetime.datetime(2000, 1, 5, 0, 0)]
[datetime.datetime(2014, 11, 6, 0, 0) datetime.datetime(2005, 9, 15, 0, 0)
datetime.datetime(2008, 11, 5, 0, 0) datetime.datetime(2007, 6, 9, 0, 0)
datetime.datetime(2003, 11, 10, 0, 0)]
1 loop, best of 3: 4.18 s per loop
2017-05-13 22:48:12 +08:00
回复了 kingmo888 创建的主题 Python 这一行 Python 代码,如何更快的提高运算速度?
...不会用 v2 的贴图..直接上代码了 5000 次循环秒出 <br>
import datetime
import numpy as np

if __name__ == '__main__':
array = np.array([])
for i in xrange(5000):
year = np.random.randint(100) + 2000
month = np.random.randint(12) + 1
day = np.random.randint(27) + 1
array = np.append(array, datetime.datetime(year, month, day))
end = datetime.datetime(2050, 5, 3)
print array[array[:]>end][-5:]
2017-05-11 10:29:15 +08:00
回复了 swordspoet 创建的主题 求职 ~~~求一份 数据分析师 实习~~~
搞这行你这学历很吃亏的....而且技术上一般也是要发过 paper 或者 kaggle 打比赛有个比较好的成绩吧....另外老哥你简历里面博客连接有问题
……我好奇的时候找工作的时候别人要看你 github 你怎么介绍这项目……
2017-05-03 15:14:21 +08:00
回复了 curiosity 创建的主题 数据库 难: 20G 的 txt 文本,求如何导入 Excel?
java nio MappredByteBuffer
@ainimuyan 那要这么说,我也看过姚班去 CMU 的,人家做机学深学编译器 这已经不是一个层次的了
好多鸡汤啊.....
2017-04-26 14:21:00 +08:00
回复了 sunacc 创建的主题 职场话题 你怎么看待发了 offer 过几天又说没名额了的行为?
@jych1224 这两者不能换位啊....企业是强势方啊....
2017-04-20 22:07:17 +08:00
回复了 char1998 创建的主题 Python 学了 3 个月的 flask,然后使用 python2.7+flasks 搭建了一个小论坛
去学 six 吧 直接支持多个版本就好了,现在 2 系的库怎么说还是全一些吧....虽然都在向 3 转
2017-04-19 11:18:39 +08:00
回复了 yohole 创建的主题 程序员 Hadoop、Hbase 授权机制问题
zookeeper 的授权我觉得挺好懂的啊.....而且不也有用户名+密码形式吗? IP 白名单不更直白吗
1  2  3  4  5  6  7  8  9  10  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1015 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 22:04 · PVG 06:04 · LAX 15:04 · JFK 18:04
Developed with CodeLauncher
♥ Do have faith in what you're doing.