I wanted to write the code as cleanly as possible using pylint, so I decided to leave the meaning of the warning as a memorandum.
-Ubuntu 16.04 -Python 2.7.11 :: Anaconda 4.1.0 (64-bit)
$ pip install pylint
$ pylint hoge.py
For the time being, I will add only what I understand.
Missing module docstring (missing-docstring) It seems good to put a comment on the first line as follows
"""This is a test program."""
Unused matplotlib.pyplot imported as plt (unused-import) In this example, matplotlib.pyplot was imported but not used.
import matplotlib.pyplot as plt
Deleted the line
Invalid constant name "model" (invalid-name) In this example, the name model seems to be bad.
If constant,(([A-Z_][A-Z0-9_]*)|(__.*__))$
The name is MODEL because it is named according to the rules of
Module 'numpy.random' has no 'randn' member (no-member)
sample.py
'''This is a test program.'''
import numpy as np
print np.random.randn(6, 4)
The error was caught in the sample code above, but it worked fine, so Create a new ~ / .pylintrc file as shown below The judgment of numpy.random was excluded as follows.
~/.pylintrc
[TYPECHECK]
ignored-modules = numpy.random
Recommended Posts