Is it possible to have a smart contract which uses computational libraries from python? If so, how? Is there a size restriction on this?
I wish to run an algorithm inside a contract.
This is not possible, a smart contract can't use a python library or any library not supported by the compiler. you would only use the libraries written in the languages supported by the EVM like serpent or solidity.