I have 2 files in PyCharm:
parable.py:
def function_parable(a):
return [x**2 for x in a]
main.py:
import numpy as np
import matplotlib.pyplot as plt
a = [1, 2, 3, 4, 5]
a = np.array(a)
n = a.shape
print(n)
print(type(a))
print(a)
import parable as b
print(b.function_parable(a))
print(type(b))
plt.plot(a,b)
plt.show()
Error: ValueError: x and y must have same first dimension, but have shapes (5,) and (1,)
How can I maintain this structure and solve this problem? Thanks!