수강이 제한됩니다.
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
숙제 제출이 안되요
C:Usershyundaeyulepython_mooclab_2lab_2windows>submit.bat fbra81728∙ Session token prefix: e077f58efe✔ [0] Session e077f58efe is ready.Uploading files: 100%|█| 12.4k/12.4k [00:00<00:00, 448kbytes/s, file=basic_opeartions_unit_test.py]✔ [0] Uploading done.✘ [0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')요렇게 뜨네요
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 404에러
.submit.bat cvio19692∙ Session token prefix: 32fe457c60✔ [0] Session 32fe457c60 is ready.Uploading files: 100%|█████████████| 5.69k/5.69k [00:00<00:00, 158kbytes/s, file=arithmetic_unit_test.py]✔ [0] Uploading done.✘ [0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')위와 같은 오류가 과제 제출시 뜨는데 해결 방법이 뭔가요..?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 404에러
.submit.bat cvio19692∙ Session token prefix: 32fe457c60✔ [0] Session 32fe457c60 is ready.Uploading files: 100%|█████████████| 5.69k/5.69k [00:00<00:00, 158kbytes/s, file=arithmetic_unit_test.py]✔ [0] Uploading done.✘ [0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')위와 같은 오류가 과제 제출시 뜨는데 해결 방법이 뭔가요..?
- 해결됨프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출 에러납니다
C:UsersHyejeongpython-workspacewindows>submit.bat hehr122374∙ Session token prefix: 1870f7bf87✔ [0] Session 1870f7bf87 is ready.Uploading files: 100%|█| 5.71k/5.71k [00:00<00:00, 9.93kbytes/s, file=arithmetic_unit_test.py]✔ [0] Uploading done.✘ [0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')이런식으로 에러나는데 어떻게 해야할지 모르겠습니다. 마지막에 x 표시된 것이 잘못된건가요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
아톰을 설치했는데 CMD로 실행되지 않아 질문드립니다.
윈도우 10을 사용하는 유저입니다.아톰을 실행하려고 할 때마다 'atom.'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는배치 파일이 아닙니다.라는게 뜨는데 어떻게 해야 해결할 수 있을까요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출시 오류가 납니다
'''C:Usersuserworkspacepython_moocwindows>submit.bat pdox135219∙ Session token prefix: 157ef020cd✔ [0] Session 157ef020cd is ready.Uploading files: 100%|██████████████████████████| 5.69k/5.69k [00:00<00:00, 7.44kbytes/s, file=arithmetic_unit_test.py]✔ [0] Uploading done.✘ [0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')'''이런 오류가 나는데 어떻게 해야 할까요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출 오류입니다.
[0] BackendClientError('Request to the API endpoint has failed.nCheck your network connection and/or the server status.nError detail: WSServerHandshakeError("404, message=\'Invalid response status\'")')submit.bat 해쉬코드를 입력하면 이러한 오류메시지가 출력됩니다. 해결방법을 알수가 없네요 ㅠ
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
설치 에러
Collecting aiohttp~=3.4.0 (from backend.ai-client) Could not find a version that satisfies the requirement aiohttp~=3.4.0 (from backend.ai-client) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a1, 2.3.0a2, 2.3.0a3, 2.3.0a4, 2.3.0, 2.3.1a1, 2.3.1, 2.3.2b2, 2.3.2b3, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.3.10, 3.0.0b0)No matching distribution found for aiohttp~=3.4.0 (from backend.ai-client)라고 aiohttp 설치 중 에러가 뜨는데 어떻게 대처해야 하나요 ??
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출 해쉬코드는 어디서 받나요?
Code Assignment: Arithmetic 지문에 가도 해쉬코드가 없던데 어디서 받나요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
test main Fail 뜹니다. 확인좀 빨리 부탁드립니다 ㅠㅠ
def main():print("본 프로그램은 섭씨를 화씨로로 변환해주는 프로그램입니다")print("============================")===Modify codes below=================def input_celsius_value():celsius_value= float(input("변환하고 싶은 섭씨 온도를 입력해 주세요:"))return celsius_valuedef convert_celsius_fahrenheit(celsius_value):fahrenheit_value = ((9 / 5) * float(celsius_value)) + 32return fahrenheit_valuedef print_fahrenheit_value(celsius_value,fahrenheit_value):print("섭씨온도:{}n화씨온도:{}".format(celsius_value,fahrenheit_value))======================================if name == 'main':main()celsius_value = input_celsius_value()fahrenheit_value = convert_celsius_fahrenheit(celsius_value)print_fahrenheit_value(celsius_value,fahrenheit_value)print("===========================")print("프로그램이 종료 되었습니다.")
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출 안됨 for windows
우분투에서도 안됬지만 윈도우에서도 똑같이 안됩니다. D:/Workspace/lab_1/windows>submit.bat xitb숫자여섯자리 [엔터] [2K[91m✘ BackendAPIError: 500 Internal Server Error Internal server error.[0m
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제제출이 되지 않아서 질문을 드립니다.
과제를 마무리 한뒤 submit.bat 해쉬코드를 입력하면 하기와 같이 내부 서버 에러라고 표기가 되고 있습니다.확인을 부탁드립니다.![](C:UsersmamecDesktop과제제출 오류.PNG)
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 업로드 에러
과제 업로드 bash ./submit.sh xitb숫자여섯자리 [엔터]BackendAPIError: 500 Internal Server ErrorInternal server error.에러 뜹니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
with open 문제
강의 자료에 있는 csv_read.py 에서 csv 파일이 읽어지지가 않습니다.sytaxerror: EOF error는 주로 괄호를 안 닫거나 했을 때 벌어지는 error 인데 보시는 바와 같이 괄호는 제대로 닫겨 있습니다. 어제까지만 해도 된 거 같은데 lxml package 설치 후 갑자기 이럽니다. 어떻게 해야 할까요? 알려주세요File "", line 1with open("customers.csv") as customer_data:^SyntaxError: unexpected EOF while parsing
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
xml open 관련 질문입니다.
File "", line 1with open("books.xml", "r", encoding="utf8") as books_file:^SyntaxError: invalid syntax이렇게 나오는데요 왜 그런건가요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
선형대수 matrix_product 질문드립니다.
def matrix_product(matrix_a, matrix_b): if not is_product_availability_matrix(matrix_a, matrix_b): return False return [[sum(a*b for a,b in zip(i,j)) for i in matrix_a] for j in matrix_transpose(matrix_b)]2x2 행렬은 문제없었는데 3x3 product 3x2 해보니까 반례가 나옵니다.[[1,2,3],[4,5,6],[7,8,9]] product [[a,b],[c,d],[e,f]] 찍어보니[[1a 2c 3e], [4a, 5c, 6e] ...] 로 나오네요.[[1a 2c 3e], [1b 2d 3f]...] 가 되어야 하는데.. 어디서 잘못한 걸까요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
XML Read -> JSON write 숙제 제출
낙서장 같은 코드.. 이번 강의도 감사합니다! 질문. BeautifulSoup 모듈을 사용할 때는 항상 아래처럼 bs4와 함께 import해야 하나요? from bs4 import BeautifulSoup import os import re import json from bs4 import BeautifulSoup # SEPARATE XML================================================================= # setting raw_xml_file = "ipa110106.XML" target_root = "data" # read raw xml with open(raw_xml_file, "r") as raw_xml: xml_contents = raw_xml.read() # separate xml contents chopped_txts = re.findall(r'(<\?xml)([\s\S]+?)(</us-patent-application>)', xml_contents) chopped_txts = [''.join(tuples) for tuples in chopped_txts] # check dir if not os.path.isdir(target_root): os.mkdir(target_root) # make new files with separated xml contents for txt in chopped_txts: new_file_name = re.findall(r'(<us-patent-application.+file=")(.+XML)', txt) with open(os.path.join(target_root, new_file_name[0][1]), "w") as new_xml: new_xml.write(txt) # MAKE DICTIONARY============================================================== # setting data_dict = dict() source_root = "data" source_xml_files = os.listdir(source_root) # make Dictionary Data from Xml for xml_file in source_xml_files: with open(os.path.join(source_root, xml_file), "r") as xml_file: # xml tags soup = BeautifulSoup(xml_file, "lxml") publication_reference_tag = soup.find("publication-reference") application_reference_tag = soup.find("application-reference") p_document_id_tag = publication_reference_tag.find("document-id") a_document_id_tag = application_reference_tag.find("document-id") patent_dict = dict() # reset # extract info from Xml p_country = p_document_id_tag.find("country").get_text() # 등록국가 p_doc_number = p_document_id_tag.find("doc-number").get_text() # 등록번호 p_kind = p_document_id_tag.find("kind").get_text() # 등록상태 p_date = p_document_id_tag.find("date").get_text() # 등록일자 a_country = a_document_id_tag.find("country").get_text() # 출원국가 a_doc_number = a_document_id_tag.find("doc-number").get_text() # 출원번호 a_date = a_document_id_tag.find("date").get_text() # 출원일 invention_title = soup.find("invention-title").get_text() # 특허제목 # store info in Patent Dict patent_dict["publication-country"] = p_country patent_dict["publication-number"] = p_doc_number patent_dict["publication-kind"] = p_kind patent_dict["publication-date"] = p_date patent_dict["application-country"] = a_country patent_dict["application-number"] = a_doc_number patent_dict["application-date"] = a_date patent_dict["invention-title"] = invention_title # add patent info in data dict # key value is publication-doc-number data_dict[p_doc_number] = patent_dict # EXPORT TO JSON=============================================================== # setting output_root = "output" output_file = "my_first_json.json" # check dir if not os.path.isdir(output_root): os.mkdir(output_root) # (over)write on json file with open(os.path.join(output_root, output_file), "w") as json_file: json.dump(data_dict, json_file)
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
막짠 숙제 제출
강의가 거의 끝나가네요. 막짜서 구현(이라도) 할 수 있는 수준까지 왔어요 감사합니다. from bs4 import BeautifulSoup # setting field_value = tuple(["등록번호", "등록일자", "출원번호", "출원일자", "상태", "특허제목"]) data_list = [] data_list.append(field_value) # read xml file with open("ipa110106.XML", "r", encoding="utf8") as xml_file: xml = xml_file.read() # seperate xml xml_list = xml.split('<?xml version="1.0" encoding="UTF-8"?>\n') # remove empty str while 1: if "" in xml_list: xml_list.remove("") else: break # extract info for page in xml_list: # extract info from xml soup = BeautifulSoup(page, "lxml") publication_reference_tag = soup.find("publication-reference") application_reference_tag = soup.find("application-reference") p_document_id_tag = publication_reference_tag.find("document-id") a_document_id_tag = application_reference_tag.find("document-id") p_doc_number = p_document_id_tag.find("doc-number").get_text() # 등록번호 p_date = p_document_id_tag.find("date").get_text() # 등록일자 a_doc_number = a_document_id_tag.find("doc-number").get_text() # 출원번호 a_date = a_document_id_tag.find("date").get_text() # 출원일자 p_kind = p_document_id_tag.find("kind").get_text() # 상태 invention_title = soup.find("invention-title").get_text() # 특허제목 # make data_list data_list.append(tuple([p_doc_number, p_date, a_doc_number, a_date, p_kind, invention_title])) # write data on csv with open("data.csv", "w", encoding="utf8") as data_csv: for patent in data_list: data_csv.write(",".join(patent) + "\n")
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
코드 실행도 되고 에러도 없는데 Failed 뜨는 항목이 있습니다.
test_binary_converter | PASSED | Good Jobtest_comparison_list_size | PASSED | Good Jobtest_delete_a_list_element | PASSED | Good Jobtest_discount_price | FAILED | Failedtest_find_smallest_value | PASSED | Good Jobtest_merge_and_sort | PASSED | Good Jobtest_number_of_cases | PASSED | Good Jobtest_odd_even_check | FAILED | Failedtest_sum_of_list | PASSED | Good Job 이렇게 2개의 Failed 가 발생했습니다. 해당 코드는 결과도 이상없이 잘 실행되는데 무슨 문제인지 모르겠습니다. ''' def odd_even_check(a, b):odd_even = ['Odd','Even']sum = a + bif sum // 2 == 0: result_value = odd_even[1]else: result_value = odd_even[0]result = result_valuereturn resultdef discount_price(price):if price < 100000: price = price - (price * 10 // 100)else: price = price - (price * 20 // 100)result = pricereturn result'''
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
안녕하세요 . is valid morse code에서 무엇이 잘못된건지 모르겠어서 질문남깁니다. 바쁘실텐데 확인 부탁드려요 ㅠ 감사합니다.
def is_validated_morse_code(user_input):# ===Modify codes below=============# 조건에 따라 변환되어야 할 결과를 result 변수에 할당 또는 필요에 따라 자유로운 수정msg = list(set(user_input))check_list = ['.', '-', ' ', ',']flag = 0for i in range(len(msg)): if msg[i] in check_list: flag = 1 else: flag = 0 breakif flag == 1: check_list = user_input.split() for check in check_list: if check in get_morse_code_dict().values(): result = True else: result = Falseelse: result = Falsereturn result# ==================================