mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Remove code with side effects from main (#1577)
* Remove code with side effects from main When running tests withy pytest, some modules execute code in main scope and open plot or browser windows. Moves such code under `if __name__ == "__main__"`. * fixup! Format Python code with psf/black push
This commit is contained in:

committed by
Christian Clauss

parent
5616fa9e62
commit
12f69a86f5
@ -36,8 +36,9 @@ def viz_polymonial():
|
||||
return
|
||||
|
||||
|
||||
viz_polymonial()
|
||||
if __name__ == "__main__":
|
||||
viz_polymonial()
|
||||
|
||||
# Predicting a new result with Polymonial Regression
|
||||
pol_reg.predict(poly_reg.fit_transform([[5.5]]))
|
||||
# output should be 132148.43750003
|
||||
# Predicting a new result with Polymonial Regression
|
||||
pol_reg.predict(poly_reg.fit_transform([[5.5]]))
|
||||
# output should be 132148.43750003
|
||||
|
Reference in New Issue
Block a user