From ac45f60011669b89cc789a0c7e5823c10d3992a7 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 15 Jun 2018 18:55:56 -0400 Subject: [PATCH] Fix type error in TFTransformer example in README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c16fb9f..252fd618 100644 --- a/README.md +++ b/README.md @@ -353,7 +353,9 @@ samples_1 = [np.random.randn(2) + center_1 for _ in range(n_sample//2)] labels_1 = [1 for _ in range(n_sample//2)] rows = map(to_row, zip(map(lambda x: x.tolist(), samples_0 + samples_1), labels_0 + labels_1)) -sdf = spark.createDataFrame(rows) +schema = StructType([StructField("inputCol", ArrayType(FloatType())), + StructField("label", LongType())]) +sdf = spark.createDataFrame(rows, schema) ```