在numpy中生成缩小范围的1d数组(Generating 1d array of shrinking ranges in numpy)
我想在numpy中生成一个1D数组,如下所示:
In [181]: np.concatenate((np.arange(1, 4), np.arange(2, 4), np.arange(3, 4))) Out[181]: array([1, 2, 3, 2, 3, 3])
在更大范围内,伪代码:
concatenate(1:n, 2:n, 3:n, ..., n:n)
是否有一种矢量化的方式在numpy和/或pandas中这样做?
I want to generate a 1D array in numpy like this:
In [181]: np.concatenate((np.arange(1, 4), np.arange(2, 4), np.arange(3, 4))) Out[181]: array([1, 2, 3, 2, 3, 3])
On a larger scale, in pseudocode:
concatenate(1:n, 2:n, 3:n, ..., n:n)
Is there a vectorized way of doing this in numpy and/or pandas?
原文:https://stackoverflow.com/questions/23545014
满意答案
如果真的需要部署到lib / ext,最简单的方法是为你的构建提供一个自定义的jdk(称之为Java6_With_MyProduct),在其中提供zipped / tar'gz'ed)jdk。
请您的管理员将其包含在Jenkins配置中。
这样,你的(只有你的版本)会得到你的扩展jdk。
或者,您可以使用-Djava.ext.dirs系统属性来覆盖扩展目录。 那样,你会的
- 将扩展程序作为预建步骤复制到工作区中
- 将原始扩展从$ JAVA_HOME / jre / lib / ext复制到同一目录中
- 将-Djava.ext.dirs = $ WORKSPACE / myextensions设置为MAVEN_OPTS(仅当需要扩展才能实际构建项目时)
- 将-Djava.ext.dirs = $ WORKSPACE / myextensions添加到argLine中以获取surefire和failfast插件
开放的问题是:你真的需要那些扩展来构建你的项目吗?
If it is really necessary to deploy than into lib/ext, the easiest way would be to provide a custom jdk for your build (call it Java6_With_MyProduct), in which you provide the zipped/tar'gz'ed) jdk.
Ask your administrators to include it into the Jenkins configuration.
That way, YOUR (and only your builds) would get your extended jdk.
Alternatively, you could use the -Djava.ext.dirs system property to override the extension directory. That way, your would
- copy your extension into your workspace as a prebuild step
- copy the original extensions from $JAVA_HOME/jre/lib/ext into the same directory
- set -Djava.ext.dirs=$WORKSPACE/myextensions as MAVEN_OPTS (only if the extension is required to actually BUILD the project)
- add -Djava.ext.dirs=$WORKSPACE/myextensions to the argLine for surefire and failfast plugins
The open question is: do your really need those extensions to BUILD your project?
相关问答
更多如何在Jenkins / Maven / Git中标记构建(Publish Maven build to Artifactory from Jenkins)
詹金斯和梅文(Jenkins and Maven)
应该在lib / ext中放置一个jar文件而不是在Windows XP上使用CLASSPATH吗?(Should putting a jar file in lib/ext work instead of using a CLASSPATH on Windows XP?)
我如何使用maven将lib文件夹中的jar添加为单独的依赖项(How can i add the jars in my lib folder as individual dependencies using maven)
javac找不到已安装在jre / lib / ext中的jar文件(javac can't find jar files that have been installed in jre/lib/ext)
使用jenkins构建的maven没有从本地.m2存储库中获取jar(maven build with jenkins not picking up jar from local .m2 repository)
如何在Jenkins / Maven构建中管理jre / lib / ext jar?(How do I manage jre/lib/ext jars in a Jenkins/Maven build?)
Jenkins CI服务器中的Maven项目问题(Issue with Maven Project in Jenkins CI server)
将JAR从$ HOME / jre / lib / ext移动到Gradle时出现JDBC错误(JDBC Error when moving JAR from $HOME/jre/lib/ext to Gradle)
将挂毯jar放入tomcat lib目录是不对的?(is it wrong to deploy tapestry jars into tomcat lib directory?)
相关文章
更多3d引擎列表
java3d的前景
JOGL 处理3D图形
About Unity3D 4.1.2 (to continue…)
报错说找不到abbrev这个方法,但Array有这个方法的吧?
想开发3D引擎
Python内建函数(D)
3D音频理论研究(二)---3D全介绍(转)
Autodesk Map 3D 2012 新功能介绍
mysql删除外键(Cannot drop index 'FK7D676EBBD0A6D8FD': needed in a foreign key constraint)
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!