Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
spark:spark-introduction [2014/11/11 09:07] straka |
spark:spark-introduction [2014/11/11 09:11] straka |
||
---|---|---|---|
Line 63: | Line 63: | ||
===== K-Means Example ===== | ===== K-Means Example ===== | ||
- | An example implementing [[http:// | + | An example implementing [[http:// |
<file python> | <file python> | ||
import numpy as np | import numpy as np | ||
Line 71: | Line 71: | ||
lines = sc.textFile("/ | lines = sc.textFile("/ | ||
- | data = lines.map(lambda line: map(float, line.split())).cache() | + | data = lines.map(lambda line: np.array(map(float, line.split()))).cache() |
K = 50 | K = 50 |