我是Spark和Java的新手。我试图使用maven依赖项在Eclipse中设置spark环境。我使用Java 1.8与Scala 2.11.7。我在Eclipse中创建了一个Scala项目并创建了一个maven依赖项。
import numpy as np
#here are two arrays to join together
a = np.array([1,2,3,4,5])
b = np.array([6,7,8,9,10])
#here comes the joining step I don't know how to do better
#QUESTION 1: How to form all permutations of two 1D arrays?
temp = np.array([]) #empty array to be filled with values
for aa in a:
for bb in b:
temp = np.append(temp,[aa,bb]) #fill the array
#QUESTION 2: Why do I have to reshape? How can I avoid this?
temp = temp.reshape((int(temp.size/2),2))
现在我收到一个错误“无法转移org.spark-project.spark:unused:jar:1.0.0来自https://repo.maven.apache.org/maven2缓存在本地存储库中,分辨率将不会重新尝试直到中心的更新间隔已经过去或强制更新。“
答案 0 :(得分:0)
我也是新人。这些是我使用eclipse,scala 2.11,maven和spark的步骤:1。创建一个maven项目2.-使用此POM作为基本方向https://github.com/entradajuan/Spark0/blob/master/Spark0/pom.xml 3.-将项目转换为Scala:right buton-> configure->转换为Scala 4.-然后在src / main / java中创建一个包5.-在新包中使用def main创建一个scala对象
到目前为止,我总是以同样的方式开始。我不在项目中使用Java。 它在运行maven build“clean install”以获取jar时也能正常工作。