. Advertisement .
..3..
. Advertisement .
..4..
For the “syntaxerror: multiple statements found while compiling a single statement” problem. I tried to fix it, but It doesn’t work and returns the result I want. Here is my program:
import sklearn as sk
import numpy as np
import matplotlib.pyplot as plt
and
SyntaxError: multiple statements found while compiling a single statement
has occurred. I’ve checked the entire command line but still can’t find the mistake.
The cause: I think the reason for this is that you can’t execute more than one statement at a time in the shell:
The solution: To solve this problem, you must carry them out one by one:
To use the on-line interactive shell, you can separate all commands with semi-colons like this: import sklearn as sk;import numpy as np;import matplotlib.pyplot as plt. You can create a new file by typing control+n and then saving it with control+s before running it from pylab by clicking run > run module.