-
Notifications
You must be signed in to change notification settings - Fork 29k
Added description to python spark Pi example #19632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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` ) | ||
|
||
| # while calling this script, the default value assigned is 2 | ||
| partitions = int(sys.argv[1]) if len(sys.argv) > 1 else 2 | ||
| n = 100000 * partitions | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
below example -> example below