```
from numpy import poly1d
P = poly1d([3.4, -5.22, 2, 1, -7.1], variable = 'x')
print("Here is a polynomial\n")
print(P)
print("\nIts complex roots as a numpy array:")
print(P.r)
print("\nIts complex roots as a python list:")
print(list(P.r))
"""my output -->
Here is a polynomial
4 3 2
3.4 x - 5.22 x + 2 x + 1 x - 7.1
Its complex roots as a numpy array:
[ 1.57667814+0.j 0.43601402+1.12245146j 0.43601402-1.12245146j
-0.91341205+0.j ]
Its complex roots as a python list:
[(1.5766781395927345+0j), (0.43601401578206267+1.1224514554841667j), (0.43601401578206267-1.1224514554841667j), (-0.91341205350980392+0j)]
"""
```

*Edited 2 Years Ago by Gribouillis*

*Edited 6 Years Ago by Gribouillis*: n/a

*Edited 2 Years Ago by Gribouillis*

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.