ufunc 'add' did not contain a loop with signature matching types (dtype('<U170'), dtype('<U170')) -> dtype('<U170')

반응형

안녕하세요?

 

이 에러 메세지 원인을 못찾아서 거의 한시간을 헤멨습니다.

혹시, 이 에러 원인을 찾는 분이 계시다면 도움되시길 바랍니다.

 

다른 분들은 어떤 부분에서 에러나는지 모르겠지만,

저는 하기 sqlCode Text 문장을 만들어서 

 

try: 

    sqlCode = "select date, low from '" + ticker + "' t1 where t1.date <= (select max(t2.date) from '" + ticker + "' t2

    where t2.date < ( select date(max(t3.date), '-1 day') from '" + ticker + "' t3) and t2.low < " + current_price + ")"

 

    chart_data_low = pd.read_sql(sqlCode, con, index_col=None) # 추가로 인덱스 칼럼이 생성되지 않도록 한다.

except Exception as e:
    self.logging.logger.debug("(%s) retrieve_db_chart_data_low Exception발생: %s" % (ticker, e))
    print("chart_intervals: %s" % chart_intervals)

 

이렇게 하는 과정에서 Exception Error가 발생했습니다.

 

sqlCode 문자열을 생성할때, 문자열들만의 문자열 합하기가 되도록 중간중간의 인자값을 잘 확인하시기 바랍니다.

 

그럼, 즐(거운)파(이썬) 하시길 바랍니다.

반응형

댓글()