묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
nlp 군집화 실습
여기 문서 군집화 소개와 실습(Opinion Review 데이터 세트)에서요 import pandas as pd import glob, os path = r'/content/gdrive/My Drive/MachineLearning/OpinosisDataset1.0/topics' all_files = glob.glob(os.path.join(path, "*.data")) filename_list = [] opinion_text = [] for file_ in all_files: df2 = pd.read_table(file_, index_col=None, header=0, encoding='latin1') filename_ = file_.split('/')[-1] filename = filename_.split('.')[0] filename_list.append(filename) opinion_text.append(df2.to_string()) document_df = pd.DataFrame({'filename':filename_list, 'opinion_text':opinion_text}) document_df.head() document_df.dtypes document_df['opinion_text'] 이렇게 치면 opinion_text 가 보이지 않고 opinion_text.append(df2.to_string()) 여기서 to_string() 을 없애면 잘 보이는데 이 to_string() 의 의미와 역할이 궁금하고 from sklearn.feature_extraction.text import TfidfVectorizer tfidf_vect = TfidfVectorizer(tokenizer=LemNormalize, stop_words='english' ,ngram_range=(1,2), min_df=0.05, max_df=0.85 ) feature_vect = tfidf_vect.fit_transform(document_df['opinion_text']) feature_vect 이 구문에서 feature_vect = tfidf_vect.fit_transform(document_df['opinion_text']) 여기에서 'DataFrame' object has no attribute 'lower'오류가 뜨는데 이유가 뭘까요.. 이것만 하루죙일 고민했는데 답이 안나오네요
-
미해결실전 프로젝트로 배우는 타입스크립트
live server 관련 문제 입니다.
live server 을 vs code 에 설치 했는데 open with live server 가 안뜨더라구요 ㅠ 어떻게 해야죠?
-
미해결파이썬 무료 강의 (활용편1) - 추억의 오락실 게임 만들기 (3시간)
키이벤트 작성할 때
if event.type==pygame.KEYDOWN: #키가 눌렸는지 확인 if event.key == pygame.K_LEFT: #캐릭터 왼쪽으로 to_x -=5 #to_x= to_x-5 elif event.key == pygame.K_RIGHT: #캐릭터 오른쪽으로 to_x +=5 elif event.key == pygame.K_UP: #캐릭터 위로 to_y -=5 # 2D 개념 / 길이-이동범위/ 위에서부터 길이 elif event.key ==pygame.K_DOWN: #캐릭터 아래로 to_y +=5 if event.type ==pygame.KEYUP: # 방향키를 떼면 멈춤 if event.key == pygame.K_LEFT or event.key ==pygame.K_RIGHT: to_x=0 elif event.key==pygame.K_UP or event.key==pygame.K_DOWN: to_y=0 왜 키 눌릴 때/ 키에서 땔 때를 이분법적으로 나누어 if와 elif로 설정하지 않고, 각각 따로 if문을 만드는 건가요?^^
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
조건문
현재 컴퓨터 고장으로 직접 파이썬 실행이 안되어 이렇게 질문드리는 점 양해 부탁드립니다. 1. if true : print('good') good으로 출력된다고 하셨는데 이유가 뭐죠? 'true : ' 뒤가 비어있으면 false 아닌가요? 2. if 'a' : print('good') 은 good으로 출력되는게 a가 문자라서 그런거죠? 3. Print(‘e3 :’, 5+10 > 3 and 7+3 == 10) - e3 : true 여기서, = 을 1개만 써도 되나요? 4. score1 = 90 , score2 = ‘a’ if(score1 >= 90 and score2 == 'a')라고 하면 출력이 true로 나오나요?
-
미해결C 프로그래밍 - 입문부터 게임 개발까지
파일을 열 수 없습니다 오류
#include <stdio.h> int main(void) { printf("Hello World"); return 0; } 위와 같이 작성해준 후 F5키를 눌러 실행시켜 주었더니 "빌드 오류가 발생했습니다. 계속하고 마지막으로 성공한 빌드를 실행하시겠습니까?" 라는 문구가 나온 후, "예"를 클릭하면 "프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다."라는 오류가 뜨는 데 무엇이 문제일까요ㅜㅜ
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
깃 추가부탁드립니다.
인프런 아이디 : kokosed@nate.com인프런 이메일 : kokosed@nate.com깃헙 아이디 : dajobapps@gmail.com깃헙 Username : minseong1972 추가부탁드립니다.
-
미해결파이썬 무료 강의 (활용편2) - GUI 프로그래밍 (4시간)
우앙 만들어 봤는데 좋나여?
라디오 버튼 응용 했는데 좋아 보이나요? 아이스크림도 넣을 거에여^^ 엄청 재밌네여 코드 --> from tkinter import * import time root = Tk() root.title("SeoJY GUI") root.geometry("640x480+100+50") # 가로 * 세로 Label(root, text="메인 메뉴를 선택하세요").pack() bugger_var = StringVar() btn_bugger1 = Radiobutton(root, text="치즈버거", value="치즈버거", variable=bugger_var) btn_bugger1.select() btn_bugger2 = Radiobutton(root, text="치킨버거", value="치킨버거", variable=bugger_var) btn_bugger3 = Radiobutton(root, text="새우버거", value="새우버거", variable=bugger_var) btn_bugger1.pack() btn_bugger2.pack() btn_bugger3.pack() Label(text="사이드 메뉴를 선택하세요").pack() side_var = StringVar() btn_side1 = Radiobutton(root, text="치즈스틱", value="치즈스틱", variable=side_var) btn_side1.select() btn_side2 = Radiobutton(root, text="치즈볼", value="치즈볼", variable=side_var) btn_side1.pack() btn_side2.pack() side_var2 = StringVar() btn_side3 = Radiobutton(root, text="감자튀김", value="감자튀김", variable=side_var2) btn_side3.select() btn_side4 = Radiobutton(root, text="감자튀김 + 칠리소스", value="감자튀김 + 칠리소스", variable=side_var2) btn_side5 = Radiobutton(root, text="감자튀김 + 치즈소스", value="감자튀김 + 치즈소스", variable=side_var2) btn_side3.pack() btn_side4.pack() btn_side5.pack() Label(text="음료를 선택하세요").pack() drink_var = StringVar() btn_drink1 = Radiobutton(root, text="콜라", value="콜라", variable=drink_var) btn_drink1.select() btn_drink2 = Radiobutton(root, text="사이다", value="사이다", variable=drink_var) btn_drink1.pack() btn_drink2.pack() def btncmd(): print(bugger_var.get()) time.sleep(0.5) print(drink_var.get()) time.sleep(0.5) print(side_var.get()) time.sleep(0.5) print(side_var2.get()) time.sleep(2) print("주문이 완료되었습니다.") root.quit() btn = Button(root, text="주문", command=btncmd) btn.pack() root.mainloop()
-
미해결실전! 웹사이트제작! Step by Step! ('라한호텔' 사이트제작_Application Course)
강의중에 질문이 있습니다.
header .book 영역에서 display:inline-block 을 하고 float:letf 를 주게되면 inline-block 상태에서는 안된다고 계속 오류가 나는데 단순하게 inline을 주고나면 정상적으로 작동되는데 이건 왜 그런건가요? (이제 코딩입문한지 한달차라 너무 기초적인거 여쭤보는게 죄송합니다 ㅠ 참고로 브라켓말고 vscode 사용중입니다!)
-
해결됨반응형 웹사이트 포트폴리오(App Official Landing Website)
수업 자료 중 에밋 단축키 파일이 어디있을까요?
수업 자료 다운받았는데 "에밋 핵심 단축키" 파일이 안보입니다!
-
미해결코딩의민족 앱 제작 (Android kotlin)
list_array값 넣을 때 for문으로 넣었는데요. 리스트 화면이 안나와요..
package com.example.comin.Zzimimport androidx.appcompat.app.AppCompatActivityimport android.os.Bundleimport android.util.Logimport android.widget.ImageViewimport android.widget.ListViewimport android.widget.Toastimport com.example.comin.Rimport com.example.comin.Utils.FirebaseUtilsimport com.google.firebase.firestore.DocumentSnapshotclass ZzimActivity : AppCompatActivity() { val array_list = ArrayList<String>() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_zzim) val zzimAdapter = ZzimAdapter(this, array_list) findViewById<ListView>(R.id.zzim_listview).adapter = zzimAdapter FirebaseUtils.db.collection("zzim").document(FirebaseUtils.getUID()).get() .addOnSuccessListener { documents -> for(i in documents.data?.keys!!){ Log.e("ddddddd", "key : ${i}") Log.e("ddddddd", "value : ${documents.get(i)}") if (documents.get(i) == true){ array_list.add(i.toString()) } } zzimAdapter.notifyDataSetChanged() } }} 저는 이렇게 했는데 로그도 잘나오고 array_list도 찍어보면 잘 나오거든요. 그래서 zzimAdapter.notifyDataSetChanged() 이걸 안 넣어서 안 나오나 해서 넣어봐도 찜 목록이 나오질 않는데 어떻게 해야할까요??
-
해결됨[개정판] 파이썬 머신러닝 완벽 가이드
과적합과 eta
233페이지에 과적합 문제가 심각하다면 eta값을 낮추라고 했는데, 학습률은 overshooting과 local minima문제와 관련된 것이지, 과적합과는 관계가 없는 것 아닌가요?
-
미해결프로그래밍 시작하기 : 웹 입문 (Inflearn Original)
모양이 조금 다릅니다..
안녕하세요. 영상을 보고 똑같이 만들었는데 저 공백부분은 간격이 왜이렇게 넓은지 .. 두번씩 다시 코딩해보아도 잘 못찾겠습니다.
-
미해결타입스크립트 입문 - 기초부터 실전까지
선생님 자꾸 질문드려서죄송합니다. [ function]
function fetchItems2() { let items2 = ['a', 'b', 'c']; return new Promise(function (resolve) { resolve(items2); }) } tsconfig.json { "compilerOptions": { "allowJs": true, "checkJs": true, "noImplicitAny": true, // 묵시적으로 any로도 해라는 것 "strict": true, "strictFunctionTypes": true, }, "include": ["./src/**/*"] } .eslintrc.js module.exports = { root: true, env: { browser: true, node: true, jest: true, }, extends: [ "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", ], plugins: ["prettier", "@typescript-eslint"], rules: { "prettier/prettier": [ "error", { singleQuote: true, semi: true, useTabs: false, tabWidth: 2, printWidth: 80, bracketSpacing: true, arrowParens: "avoid", }, ], // "@typescript-eslint/no-explicit-any": "warn", // "@typescript-eslint/explicit-function-return-type": "off", // "prefer-const": "off", }, parserOptions: { parser: "@typescript-eslint/parser", }, }; 설정했는데.. 선생님 화면하고 다른 부분은 function에 밑줄 안들어옵니다... 왜 그런걸까요?....
-
파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
코딩테스트를 볼 언어 선택에 관한 질문입니다
삭제된 글입니다
-
미해결파이썬 무료 강의 (활용편1) - 추억의 오락실 게임 만들기 (3시간)
TypeError: invalid destination position for blit
위와 같은 에러가 납니다.. ball을 cat으로 쓴 점 감안해주시면 감사하겠습니다. error: File "c:\Users\user\Desktop\pygame_basic\1_create_frame.py", line 159, in <module> screen.blit(cat_images[cat_img_idx], (cat_pos_x, cat_pos_y)) TypeError: invalid destination position for blit --source import pygame, os pygame.init() # 초기화 필수 # 게임 화면 크기 설정 screen_width = 640 # 가로 크기 screen_height = 480 # 세로 크기 screen = pygame.display.set_mode((screen_width, screen_height)) # 화면 타이틀 설정 pygame.display.set_caption('강아지가 츄르주는 게임') # 게임 이름 # FPS clock = pygame.time.Clock() # 1. 사용자 게임 초기화 # 이미지 불러오기 current_path = os.path.dirname(__file__) # 현재 파일 위치 반환 image_path = os.path.join(current_path, "images") # 배경 이미지 background = pygame.image.load(os.path.join(image_path, "background.png")) # 스테이지 stage = pygame.image.load(os.path.join(image_path, "stage.png")) stage_size= stage.get_rect().size stage_height = stage_size[1] # 스테이지 높이 # 캐릭터 만들기 character = pygame.image.load(os.path.join(image_path, "puppy.png")) # 70*70 캐릭터 불러오기 character_size = character.get_rect().size # 캐릭터 이미지의 가로 세로 크기를 가져옴 character_width = character_size[0] # 캐릭터의 가로 크기 character_height = character_size[1] # 캐릭터의 세로 크기 character_x_pos = (screen_width - character_width) / 2 # x position = 화면 가로의 절반에 위치 하도록 (캐릭터의 x 좌표) character_y_pos = screen_height - stage_height - character_height + 10 # 이동할 좌표 chracter_to_x = 0 # 이동 속도 character_speed = 0.4 # 무기 만들기 weapon = pygame.image.load(os.path.join(image_path, "weapon.png")) # 무기 이미지 불러오기 weapon_size = weapon.get_rect().size weapon_width = weapon_size[0] # 무기 동작: 무기는 한 번에 여러 발 발사 가능 weapons = [] # 무기 이동 속도 weapon_speed = 10 # target cat_images = [ pygame.image.load(os.path.join(image_path, "cat0.png")), pygame.image.load(os.path.join(image_path, "cat1.png")), pygame.image.load(os.path.join(image_path, "cat2.png")), pygame.image.load(os.path.join(image_path, "cat3.png")) ] # 타겟 크기에 따른 최초 스피드 cat_speed_y = [-18, -15, -12, -9] # index 0 1 2 3 - cat 1 2 3 4 # 타겟들 cats = [] # 최초 발생하는 큰 고양이 추가 cats.append({ "pos_x" : 50, # 고양이의 x 좌표 "pos_y" : 50, # 고양이의 y 좌표 "img_idx" : 0, # 고양이의 이미지 인덱스 "to_x" : 3, # 고양이의 x축 이동 방향, -3이면 왼쪽으로 3이면 오른쪽ㅇfh "to_y" : -6, # y축 이동 방향 "init_spd_y" : cat_speed_y[0] # y축 최초 속도 }) # 폰트 정의 game_font = pygame.font.Font(None, 40) # 폰트 객체 생성 (폰트, 크기) # 게임 총 시간 total_time= 10 # 시작 시간 계산 start_ticks = pygame.time.get_ticks() # 현재 tick 정보를 받아옴 # event loop running = True # 게임이 진행 중인가? while running: dt = clock.tick(30) # delta = clock. FPS 설정 for event in pygame.event.get(): # 키보드에 맞는 이벤트 실행되면 if event.type == pygame.QUIT: # 창 끄기 이벤트 발생 시 running = False if event.type == pygame.KEYDOWN: # 키가 눌러졌는데 확인 if event.key == pygame.K_RIGHT: chracter_to_x += character_speed elif event.key == pygame.K_LEFT: chracter_to_x -= character_speed elif event.key == pygame.K_SPACE: # 스페이스바 누르면 무기 발사 weapon_x_pos = character_x_pos + (character_width / 2) - (weapon_width / 2) weapon_y_pos = character_y_pos weapons.append([weapon_x_pos, weapon_y_pos]) elif event.key == pygame.K_UP: pass elif event.key == pygame.K_DOWN: pass if event.type == pygame.KEYUP: # 방향키를 뗐을 때 if event.key == pygame.K_RIGHT or event.key == pygame.K_LEFT: chracter_to_x = 0 elif event.key == pygame.K_UP or event.key == pygame.K_DOWN: pass # 캐릭터 움직이기 character_x_pos += chracter_to_x * dt # FPS에 따라 속도가 변하지 않게 delta 값을 곱해주어 고정해줌 # 캐릭터 가로 경계값 처리 if character_x_pos < 0: character_x_pos = 0 elif character_x_pos > screen_width - character_width: character_x_pos = screen_width - character_width # 무기 위치 조정 weapons = [[w[0], w[1] - weapon_speed] for w in weapons] # 무기가 천장에 닿으면 없애기 # weapons = [[w[0], w[1]] for w in wea pons if w[1] > 0] # 타겟 위치 정의 for cat_idx, cat_val in enumerate(cats): cat_pos_x = cat_val["pos_x"] cat_pos_y = cat_val["pos_y"] cat_img_idx = cat_val["img_idx"] cat_size = cat_images[cat_img_idx].get_rect().size cat_width = cat_size[0] cat_height = cat_size[1] # 가로 경계값: 타겟의 경계값 처리 -> 경계값이 닿으면 반대 쪽으로 튕김 if cat_pos_x < 0 or cat_pos_x > (screen_width - cat_width): cat_val["to_x"] *= -1 # 세로 경계값: 스테이지에 튕겨서 올라감 if cat_pos_y >= (screen_height - stage_height - cat_height): cat_val["to_y"] = cat_val["init_spd_y"] else: # 그 외 모든 경우에는 to_y를 증가 cat_val["to_y"] += 0.5 cat_val["pos_x"] += cat_val["pos_x"] cat_val["pos_y"] += cat_val["pos_y"] # 충돌 처리를 위한 rect 정보 update character_rect = character.get_rect() character_rect.left = character_x_pos character_rect.top = character_y_pos # screen.fill((r, g, b)) # rgb 값으로 배경색 채울 수도 있음 screen.blit(background, (0, 0)) # 배경 이미지를 어디서부터 나타내줄건지. 0, 0 -> 왼쪽 맨 위부터 for weapon_x_pos, weapon_y_pos in weapons: screen.blit(weapon, (weapon_x_pos, weapon_y_pos)) for idx, val in enumerate(cats): cat_pos_x = val["pos_x"] cat_pos_y = val["pos_y"] cat_img_idx = val["img_idx"] screen.blit(cat_images[cat_img_idx], (cat_pos_x, cat_pos_y)) screen.blit(stage, (0, screen_height - stage_height)) screen.blit(character, (character_x_pos, character_y_pos)) # 캐릭터 그리기 # 타이머, 경과 시간 계산 elapsed_time = (pygame.time.get_ticks() - start_ticks) / 1000 # 초단위로 표시 timer = game_font.render(str(int(total_time - elapsed_time)), True, (255, 0, 0)) screen.blit(timer, (10, 10)) # 시간이 0 이하면 game over if(total_time - elapsed_time <= 0): print("Game Over") running = False pygame.display.update() # 게임 화면 다시 그리기 # 잠시 대기 pygame.time.delay(2000) # 2초 대기 # pygame 종료 pygame.quit()
-
미해결it 취업을 위한 알고리즘 문제풀이 입문 (with C/C++) : 코딩테스트 대비
강의 문제푸는 방법에대해 여쭤봅니다
안녕하세요 선생님 강의가 처음부터 선생님이랑 문제를 같이 푸는방식으로 진행하시잖아요? 궁금한점이 강의를 듣기전에 문제를 풀어보고 강의를 듣는게 맞는걸까요? 아니면 처음 몇개의 섹션까지는 그냥 강의만 듣다가 나중에가서 미리 문제를 고민하고 풀어본후에 강의를 듣는식으로 할까요? 처음부터 다 고민해보고 풀어보고 강의를 듣는게 제일 좋을것 같지만 지금 시간이 한정적이어서요 ㅜㅜ
-
미해결모든 개발자를 위한 HTTP 웹 기본 지식
cache-control: no-cache 질문
안녕하세요. 만약 cache-control: no-cache로 설정했을 경우, 모든 요청을 원 서버에 검증해야한다고 이해했습니다. 그럼 no-cache를 사용하는 이유는 원 서버에 검증을 하고 데이터 변경이 이루어지지 않았다면 cache에 저장된 데이터를 사용함으로써 네트워크 크기를 줄이기 위해 사용한다고 이해하면 될까요?? 아 그리고 해당 강의를 학습하며 공부한 내용을 블로그에 정리하여 포스팅하고 싶은데 PDF 이미지 몇 개를 캡처하여 사용해도 괜찮을까요?? (출처는 당연히 밝히겠습니다!)
-
해결됨피그마(Figma)를 활용한 UI디자인 입문부터 실전까지 A to Z
에릭 쌤!
와이어프레임 워크플로우까지 했는데요. 마지막에 내가 연결한거 확인해보려면 어떻게 해야하나요? 오토 에로우 플러그인 사용만하고 그냥 끝나서.. 엇 내가 제대로 했나? 나중에 팀원들한테 공유할때 어떻게 보여줘야하지? 이런 생각이 들더라구요. 알려주시면 감사하겠습니다. 영상 잘보고 있어요.^^
-
해결됨스프링 핵심 원리 - 기본편
코드에 오류가 납니다!
지금 이렇게 똑같이 넣엇는데... NoSuchBeandefinitionException이 터지는데 이유를 모르겠습니다. DiscountService.class만 넣었을 때는 문제가 없었는데 AutoAppConfig.class를 넣자마자 바로 에러가 터져버립니다. ㅠ 도와주십시오 선생님ㅠㅠ
-
미해결Vue.js 끝장내기 - 실무에 필요한 모든 것
eslint 오류?
강의 내용을 따라하다 보니 이것과 같이 빨간 줄이 생기고 App.vue에서는 빨간줄이 보이질 않는데.. 왜그럴까요?