I am trying to print the name of an object
import pandas as pd
from sklearn.svm import SVC
pd.set_option('display.max_columns', None, 'display.width', 2500)
est = SVC(kernel='poly')
print(est)
The output is:
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,
decision_function_shape='ovr', degree=3, gamma='auto_deprecated',
kernel='poly', max_iter=-1, probability=False, random_state=None,
shrinking=True, tol=0.001, verbose=False)
I would like to print this output in just 1 line (not 4). Do you know how to do that?
You can use str function :
def print_line(obj)
print( str(obj).replace('\n','') )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.