[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-07 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/19632


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-06 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r149078025
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
 """
 spark = SparkSession\
 .builder\
 .appName("PythonPi")\
 .getOrCreate()
 
+# If no arguments are passed(i.e. `len(sys.argv) < = 1` )
--- End diff --

Missing space after passed, problem in "< ="
This comment just restates the code below.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-06 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r149077918
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
--- End diff --

below example -> example below


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-02 Thread animenon
Github user animenon commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r148628286
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
 """
 spark = SparkSession\
 .builder\
 .appName("PythonPi")\
 .getOrCreate()
-
+
+# If no arguments are passed(i.e. `len(sys.argv) < = 1` ) 
--- End diff --

@srowen Added a line to the 
[index.md](https://github.com/apache/spark/pull/19632/commits/173fd29f20eab1ca8384413548deb5aac509d629)
 as well, I think it would help the curious ones know what algorithm is used 
and why an argument(i.e. 10) is passed.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-02 Thread animenon
Github user animenon commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r148620630
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
 """
 spark = SparkSession\
 .builder\
 .appName("PythonPi")\
 .getOrCreate()
-
+
+# If no arguments are passed(i.e. `len(sys.argv) < = 1` ) 
--- End diff --

This is actually the first example on the spark doc and I wanted to know 
how the `pi` calculation was done. There was no mention of what algorithm is 
used for it, so took me a while to figure out the Monte-Carlo estimator was 
used and the logic is randomly generating over 10 points to finally 
estimate the Pi value.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-01 Thread holdenk
Github user holdenk commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r148430264
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
 """
 spark = SparkSession\
 .builder\
 .appName("PythonPi")\
 .getOrCreate()
-
+
+# If no arguments are passed(i.e. `len(sys.argv) < = 1` ) 
--- End diff --

So I think we should expect folks to read the examples in addition to 
running them. That being said I don't think we need this comment specifically.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #19632: Added description to python spark Pi example

2017-11-01 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/19632#discussion_r148370955
  
--- Diff: examples/src/main/python/pi.py ---
@@ -27,12 +27,16 @@
 if __name__ == "__main__":
 """
 Usage: pi [partitions]
+
+Monte Carlo method is used to estimate Pi in the below example.
 """
 spark = SparkSession\
 .builder\
 .appName("PythonPi")\
 .getOrCreate()
-
+
+# If no arguments are passed(i.e. `len(sys.argv) < = 1` ) 
--- End diff --

This isn't visible to end users, so don't know if this matters. It's 
already documented in the usage. I am not sure this meaningfully helps.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org