首页 \ 问答 \ mahout哪个版本兼容hadoop1.0.3

mahout哪个版本兼容hadoop1.0.3

更新时间:2024-01-05 06:01

最满意答案

可以适当的嵌入计算时间的代码,如果是以秒为单位,可以使用time模块,

类似的代码如下,
import time
start = time.time()
...
end = time.time()
during = end - start
...
'''
other is same here. also you can use datetime module. in which you can
format the time in a friendly format to human. besides that, you can 
compute the hour, minute from second by own.
'''

其他回答

看情况似乎是某个数据结构的解析出了错。看起来象是严重的错误。
 
先试试看它的例子能不能用。如果能用,则不用理这个错误, 如果不能用考虑以下几个原因:
1. 版本,你尽量用源代码安装。或者用apt-get 安装。我习惯用apt-get
2. 是否是因为你的ubuntu太旧了?好象现在大部分人都在用12版本,13版本。11版本是一个过渡版本。你升级一下也许就解析了。可以这个就是主要问题
3. 底层的问题,我猜还是某个依赖库的版本问题

相关问答

更多
  • 1. 那就是profile和cProfile模块: import cProfile cProfile.run('function....')2. 另外,time模块,在不同的函数的开头和结尾分别计时,然后将两个时间相减,就可以获得这段函数的运行时间了,然后在看哪段函数占的时间比较大: import time t1=time.time() ##you function segment here t2=time.time() timediff=t2-t1
  • count = 0 while b==2: count += 1 if count >= 10000: break ...
  • 可以适当的嵌入计算时间的代码,如果是以秒为单位,可以使用time模块, 类似的代码如下, import time start = time.time() ... end = time.time() during = end - start ... ''' other is same here. also you can use datetime module. in which you can format the time in a friendly format to human. besides th ...
  • 它也只是O(N)。 从版本2.7.9引用与剥离空格的普通strip相对应的代码 Py_LOCAL_INLINE(PyObject *) do_strip(PyStringObject *self, int striptype) { char *s = PyString_AS_STRING(self); Py_ssize_t len = PyString_GET_SIZE(self), i, j; i = 0; if (striptype != RIGHTSTRIP) { ...
  • 你可能想看看timeit模块: http://docs.python.org/library/timeit.html 或profile模块: http://docs.python.org/library/profile.html 这里还有一些很好的教程: http://www.doughellmann.com/PyMOTW/profile/index.html http://www.doughellmann.com/PyMOTW/timeit/index.html 而且time模块也可能派上用场,尽管我更喜 ...
  • 需要注意的是,第二次导入模块时, 不会再次加载模块, 您将获得与第一次导入相同的模块对象。 当你第一次运行“test_1”时, external_library.function_foo被一个Mock对象取代,我们将其命名为mock_a 。 然后你的“模块”第一次被导入,python会加载它,意思是在“模块”里面执行代码,在“模块”的命名空间中将名称“function_foo”绑定到对象“mock_a”,保存“模块”对象到sys.modules 。 这一次你的测试会通过,并且side_effect的mock ...
  • 您是否尝试过使用分析来运行python? python -m cProfile --sort cumulative your_single_thread_script.py &> out.log 你可以在这个问题中找到更多的细节如何分析python脚本? 你可以在这里阅读关于分析工具的更多信息。 Have you tried running python with profiling? python -m cProfile --sort cumulative your_single_thread_scri ...
  • 从您链接到的profile文档: 注意事件探查器模块旨在为给定程序提供执行配置文件,而不是用于基准测试目的(因此,有合理准确结果的时间)。 这特别适用于将Python代码与C代码进行基准比较:分析器为Python代码引入了开销,但不会为C级函数开销,因此C代码看起来比任何Python代码都要快。 所以,不,你不想使用profile来测试你的代码。 你想要使用profile是为了弄清楚为什么你的代码太慢了,你已经知道它是。 并且您不希望在函数调用之前和之后输出时间戳。 如果你不小心,使用错误的时间戳函数,让G ...
  • 你可以试试 cProfile 通过这种方式: import cProfile def myFunc(): ... cProfile.run('myFunc()') 希望这能解决你的问题! You could try with cProfile in this way: import cProfile def myFunc(): ... cProfile.run('myFunc()') Hope this solves your question!
  • 将您编写的Python代码转换为计算机可以理解的指令有两个步骤: 编译步骤 。 原始Python代码转换为Python 字节码 。 任何操作系统上的Python解释器都可以在任何硬件上识别该字节码。 这是存储在.pyo或.pyc文件中的内容。 解释步骤 。 Python解释器,或者如果您更喜欢Python虚拟机,则解释字节码并将低级指令发送到计算机。 这些低级指令在Linux和Windows之间,或者在Intel芯片和AMD等之间是不同的,因此有人必须为可以运行Python的每种类型的系统编写不同的解释器。 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)