Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Rewriting functions from r to python

I have function written in R.

V <- function(c, E, HS, EC_50) E + (1 - E) / (1 + exp(HS * (c - EC_50))

I would like to get the same function in Python but I don’t know how. I haven’t used Python very much before. Therefore, I am asking for forum help.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use lambda expression

import numpy as np
v = lambda c, E, HS, EC_50: E + (1 - E) / (1 + np.exp(HS * (c - EC_50)))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading