파이썬 dtype ( 'O')에서 dtype ( 'float64')으로 배열 데이터를 캐스트 할 수 없습니다.
일부 데이터에 함수를 맞추기 위해 scipy의 curve_fit을 사용하고 있으며 다음과 같은 오류가 발생합니다. Cannot cast array data from dtype('O') to dtype('float64') according to the rule 'safe' 이것은 내 코드에서이 줄을 가리 킵니다. popt_r, pcov = curve_fit( self.rightFunc, np.array(wavelength)[beg:end][edgeIndex+30:], np.dstack(transmitted[:,:,c][edgeIndex+30:])[0][0], p0=[self.m_right, self.a_right]) rightFunc는 다음과 같이 정의됩니다. def rightFunc(self, x, m,..
2020. 10. 30.