내가 문자열로 나타납니다 팬더 dataframe의 요소와 유형 검사를 할 노력하고있어 : 내가 거짓 얻을 유형 검사를 할 경우, 그러나문자열 유형 검사
type(atmdf.ix[row]['bid'])
<type 'str'>
:
isinstance(type(atmdf.ix[row]['bid']), str)
False
내가 잘못 : 심지어 isinstance와
type(atmdf.ix[row]['bid']) is 'str'
False
나는 같은 예상치 못한 결과를 얻을?
P. 데이터 프레임의 내용은 다음과 같습니다.
atmdf.ix[row]['bid']
'28.5'
감사합니다.
따라서 귀하의 경우In [2]: isinstance('string', str)
Out[2]: True
합니다 (type(..)
밖으로 떠나) : isinstance(atmdf.ix[row]['bid'], str)
귀하의 두 번째는 '타입이어야 잘못 (atmdf.ix [행] ['입찰 ']) str'입니다 – EdChum