133 <ipython-input-75-22be5135b79e>:17: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)` df['f3'] = df['f3'].replace('vip',3) 133 정답 아래 이것이 어떤 에러 메시지인가요?
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
수업한 것을 보고 새롭게 만들었어요! 근데 사이트에서 자꾸 이게 떠요 RateLimitError : You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors . Traceback: File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling result = func() File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\streamlit\runtime\scriptrunner\script_ runner.py ", line 579, in code_to_exec exec(code, module.__dict__) File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 76, in <module> main() File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 48, in main st.info (askGpt_mart(prompt)) File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 6, in askGpt_mart response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_resources\chat_ completion.py ", line 25, in create return super().create(*args, **kwargs) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_resources\abstract\engine_api_ resource.py ", line 153, in create response, _, api_key = requestor.request( File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 700, in _interpret_response self._interpret_response_line( File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 765, in _interpret_response_line raise self.handle_error_response( 코드는 이렇게 짜여 있어요! import openai import streamlit as st def askGpt_mart(prompt): messages_prompt = [{"role": "system", "content": "친절하고 과학에 대해 깊게 알고 있는 다정한 과학자야. 그래서 답변할 때 다정하고 구체적으로 답변하고 단어가 어려우면 단어의 대체언어도 같이 나태내줘"},{"role":"user","content": f"{prompt}에 대한 실험 도구와 재료를 알려줘"}] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt_method(prompt): messages_prompt = [{"role": "system", "content": "너는 똑똑하고 친절한 과학자야. 그래서 실험 방법을 구체적으로 쉽게 설명해주고 어려운 단어는 쓰지 않아."},{"role":"user","content": f"{prompt}에 대한 실험 방법을 알려줘"}] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt_dev(prompt,prompt1,prompt2,prompt3): messages_prompt = [{"role": "system", "content": "너는 똑똑하고 친절하고 섬세한 과학자야. 원래 실험 방법에서 사용자의 환경을 고려하여 적절하게 실험 방법을 바꿔서 구체적이고 세세하게 알려주는 과학자야."},{"role":"user","content": f"나는 {prompt}에 대한 실험을 할거야. 하지만 나는 {prompt1}이 없어. 그래서 {prompt1}은 쓰지 못해. {prompt1}을 사용하는 실험 방법을 바꾸되 성공하게 하는 실험 방법을 알려줘 나는 {prompt2}에서 실험을 진행할 거야. 상황과 환경에 맞는 실험 방법을 부탁해. 또 {prompt3}(이)라는 추가적인 환경과 조건이 있으니까 이 모두를 적절히 고려해서 완전히 구체적이고 세부적이고 자세한 실험 방법을 알려줘" }] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt(prompt): messages_prompt = [{"role": "system", "content": "너는 청자가 이 실험을 처음 하는 사람인 것을 알아서 이 실험이 실패할 수 있는 일을 구체적이고 자세하게 설명하면서 그러지 않기 위해서 어떻게 해야하는지 답하는 과학자야"},{"role" : "user", "content":f"{prompt}에 대한 실험 주의사항을 구체적으로 알려줘"}] response = openai.ChatCompletion.create(model='gpt-3.5-turbo', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def main(): with st.sidebar: # Open AI API 키 입력받기 open_apikey = st.text_input(label='OPENAI API 키', placeholder='Enter Your API Key', value='',type='password') # 입력받은 API 키 표시 if open_apikey: openai.api_key = open_apikey st.markdown('---') st.header("AI 실험 도우미 ⚗️") st.markdown("---") ex_name = st.text_input("실험 이름",placeholder="거울 구리 실험, 나트륨 폭발 실험, 코끼리 실험...") co1,co2 = st.columns(2) with co1: if st.button("실험 도구 및 재료 안내"): prompt = ex_name st.info(askGpt_mart(prompt)) with co2: if st.button("실험 방법 안내"): prompt = ex_name st.info(askGpt_method(prompt)) st.markdown("===") col1,col2,col3 = st.columns(3) with col1: no_mar = st.text_input("없는 준비물",placeholder="유리막대, 비이커, 전자현미경...") with col2: where = st.text_input("장소",placeholder="집, 학교 실험실, 대학 생명과학 실험실...") with col3: add = st.text_input("추가 정보",placeholder="습도를 바꾸지 못함, 기온이 20도 이상으로 올라가지 않음...") if st.button("AI 실험 도우미"): prompt,prompt1,prompt2,prompt3 = ex_name,no_mar,where,add st.info(askGpt_dev(prompt,prompt1,prompt2,prompt3)) if st.button("주의사항"): prompt = ex_name st.info(askGpt(prompt)) if __name__=='__main__': main()
22강 마지막 부분에 제출용 데이터 프레임 생성하는 과정에서 영상과 동일하게 코드를 작성했는데 오류가 납니다. 혹시 몰라 자료로 올려주신 코드를 붙여넣기해도 동일한 오류가 나옵니다. 이런 경우에는 어떻게 해결해야 하는지 궁금합니다. 아래와 같은 오류입니다. ValueError : array length 161 does not match index length 268
22강 모델링 및 평가(회귀) 강의에서 선생님이 푸신 것에서는 랜덤포레스트에서 베이스라인보다 스탠다드스켈러에서 점수가 더 안좋아지는 결과가 나왔는데, 제가 따라서 풀어보면 베이스라인과 스탠다드스켈러의 점수도 동일하게 나오지 않고, 오히려 스탠다드스켈러의 점수가 더 좋게 나옵니다. 이렇게 다른 결과가 나오는 이유가 무엇일까요?
안녕하세요. 다익스트라는 에지의 가중치가 양수일때 출발노드에서 전체 각 노드까지의 최단거리, 벨만-포드는 특정 출발노드에서 다른 노드까지의 최단 경로 탐색, 음수 가중치가 있어도 수행 가능 이렇게 되어있는데, 벨만-포드에서 에지 사용 횟수를 강조하는 이유가 다익스트라는 출발 노드가 정해져있고, 벨만-포드는주어진 출발노드가 달라질수 있어서라고 생각하면 될까요..? 처음엔 가중치 양수, 음수만의 차이만 인줄 알았는데, 뭔가 강조하시는걸 보니 저런 이유때문인가하고 질문해봅니다..! 다들 화이팅
n,m=map(int,input().split()) weight=list(map(int, input().split())) left=0 right=(n-1) cnt=0 weight.sort() while left<=right: weight_sum=weight[left]+weight[right] if weight_sum>m: cnt+=1 right-=1 else: cnt+=1 left+=1 right-=1 print(cnt) 안녕하세요 선생님, 이렇게 left, right 포인터를 이용해서 풀어도 예제 문제는 모두 정답이 나오는데 혹시 이렇게 푸는 풀이도 답으로 가능할까요?
안녕하세요. 좋은 강의 감사합니다! a와 b의 최대 공약수 시간 복잡도에 대해 질문이 있는데요. 약수를 구하는 시간 복잡도가 O(√n)이고, 최대 공약수를 구하기 위해서는 a, b 각각의 약수를 구하는 연산이 들어가기 때문에 최소 O(√a + √b)가 될 텐데 어떻게 O(√max(a, b))가 나오게 되는지 궁금합니다.
현재 섹션 5의 3번째 영상을 보고 있습니다. category = models.ForeignKey( Category, on_delete=models.CASCADE, db_constraint=False, ) 위 코드에서 카테고리에 왜 db_constraint=False, 를 설정하였는지 이해가 잘 되지 않아 설정 용도에 대해 알고 싶습니다. default=null을 한다면, 카테고리 외래키 없이 product 데이터를 생성할 목적인걸 알겠는데, 없는 상황에서 어떤 이유에 사용하신 것인지 알고 싶습니다.