When I import R in python, using rpy2, how do I suppress warnings?
It appears that in R you have to do just the following
options(warn=-1)
…but I’m not familiar with R. How do I do this in python?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You pretty much gave the answer yourself. You can call the
options(warn=-1)function from Python by using RPy:For RPy2 it should be something like this (haven’t tried this):
Just put it at the beginning of your Python script (after the module imports) and all warnings should be suppressed.