NameError: name 'METHOD_NCUBED' is not defined
See original GitHub issueHello,
I’m not that great with Python, more of a JS dev, so I don’t know if this is correct?
When trying to pass in the parameters method, extmethod without quotes results in error. I suggest a fix.
trendln.plot_support_resistance(
hist[-1000:].Close, method="METHOD_PROBHOUGH")
Then on lines 950 - 960 of init.py
if method == "METHOD_NCUBED":
trendmethod = get_trend
elif method == "METHOD_NSQUREDLOGN":
trendmethod = get_trend_opt
elif method == "METHOD_HOUGHPOINTS":
trendmethod = houghpt
# pip install scikit-image
elif method == "METHOD_HOUGHLINES":
trendmethod = hough
elif method == "METHOD_PROBHOUGH":
trendmethod = prob_hough
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to fix "NameError: name method-name is not defined"?
Just add self. in front of it: self.method1(1). Also change your method signitures to: def method1(self, n):. and def method2(self, n):.
Read more >Python nameerror name is not defined Solution - Career Karma
A NameError means that you've tried to use a variable that does not yet exist. In this guide, we're going to talk about...
Read more >Python Errors: Nameerror name is not defined and more
For example, python nameerror name is not defined, what does this mean? You will find out by the end of this tutorial. The...
Read more >NameError: Name plot_cases_simple is Not Defined
In Python, the NameError occurs when you try to use a variable, function, or module that doesn't exist or wasn't used in a...
Read more >nameerror name is not defined python 3 - GIS Stack Exchange
Check the alignment within the print_path(begin, end) function (possibly a copy/paste issue, but as it is it will not work).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The correct solution is to either import everything e.g.
import trendln
and to as suggested usetrendln.CONSTANT_NAME
syntax or usefrom trendln import CONSTANT_NAME
. It is not necessary for these to be strings. However I will update the examples or look for scenarios where this confusion can come up so it will be corrected in the next version. These are just numeric constants with names provided for convenience. Strings might be okay as performance is not particularly an issue on these parameters but nonetheless, constants seem cleaner.@saulable It’s an enum not a string, try this one: