mattia_m
mattia_m

Reputation: 145

Import from a file in Python

I have some code like:

(main.py)

from importfile import *

(importfile.py)

import numpy as np

I have now tried the following with my main file:

npArray = np.array(0,1,2,3,4,5,6,7,8,9)
print(npArray)

But I get an error that says:

IndentationError: unindent does not match any outer indentation level

What is wrong, and how do I fix it?

Upvotes: -1

Views: 110

Answers (1)

not_yet_a_fds
not_yet_a_fds

Reputation: 315

You need to pass the numbers as list:

npArray = np.array([0,1,2,3,4,5,6,7,8,9])

Upvotes: 0

Related Questions