其他分享
首页 > 其他分享> > from pandas_schema.validation import CustomElementValidation

from pandas_schema.validation import CustomElementValidation

作者:互联网

validations = {
"not_blank": CustomElementValidation(
lambda x: x is not np.nan and len(str(x).strip()) > 0,
'cannot be blank'),
"not_empty_array": CustomElementValidation(
lambda x: x is not np.nan and len(str(x).strip().split(';')) > 0,
'cannot be empty array')
}

标签:nan,len,CustomElementValidation,cannot,strip,import,validation,lambda
来源: https://www.cnblogs.com/ivyJ/p/15928206.html