19:25 여기서 listbox라는 이름에 값을 넣었는데, 함수 정의할 때 data라는 이름으로 정의된 것이 없는데도 어떻게 data가 listbox의 값을 불러오는 건가요? 이렇게 함수를 정의해도 되는거 아닌가요? def min_max(listbox): mi = min(listbox) ma = max(listbox) return mi, ma
작업형 2 문제를 풀때 컬럼을 삭제하는 기준에서 ID와 같은것은 무조건 삭제하는것이 좋을까요? 아래와 같은 예시에서는 비행편 컬럼을 삭제하고 시작하셨는데... 카테고리수가 다르다고 함부로 삭제하는건 또 아닐거같은데 기준을 어떻게 정하면 좋을까요? 저는 비행편 컬럼을 삭제하지 않고 회귀모델을 만들었는데 rmse가 더 적게 나오긴했고요.. = print("\n ===== 카테고리 비교 =====") cols = train.select_dtypes(include='object').columns for col in cols: set_train = set(train[col]) set_test= set(test[col]) same = (set_train == set_test) if same: print(col, "\t카테고리 동일함") else: print(col, "\t카테고리 동일하지 않음") train = train.drop('flight', axis=1) test = test.drop(
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 logit 으로 테스트 데이터 학습 시킬때 data = test가 아닌 train으로 학습시키는건가요?? 문제에 예측하라그래서 test 를 데이터셋으로 넣는줄 알았는데 아니어서 여쭤봅니다
# # 자료형 변환 # df['subscribed'] = pd.to _datetime(df['subscribed']) # # df['subscribed'] = pd.to _datetime(df['subscribed'], format="%Y-%m-%d") # format 사용 위 두개 중에 저는 항상 맨 위로만 코드를 작성했는데 오늘 문제풀이를 하다보니 두번째로도 알려주시는데..첫번째 코드로만 외우면 나중에 오류가 생길까요?
혹시 이런 질문 드려도 될 지 모르겠네요. 제가 학원에서 국어 강의를 하고 있는 국어선생인데요. 주로 한글 문서를 사용해 문서를 편집하거든요. 제가 알고 싶은 것은 스타일이 적용 안된 한글 문서를 스타일 적용된(예를 들어 지문파일 스타일, 문제스타일, 보기스타일, 선택지스타일, 정답및 해설스타일 등)문서로 일괄 자동 변환 아니면 반자동 되게 하는 프로그램을 만들고 싶거든요. 이거 제가 강의 들으면 문과인 기계에 문외한인 저도 만들 수 있나요? 아니면 의뢰를 해야 하나요? 의뢰해도 만들 수 있다면 하고 싶어요. 사실 시간이 없거든요. 여기 게시판에 맞는 질문인지 모르겠네요.
Next.js 완벽 마스터 (v15): 노션 기반 개발자 블로그 만들기 (with 커서AI)
안녕하세요! 강의 잘 듣고 있습니다. 제가 혼자 실습하다가 createPostAction 의 반환값에 success 필드를 넣은 후에 useActionState 의 initialState 에도 이 필드를 아래와 같이 추가했었는데요, const [state, formAction, isPending] = useActionState(createPostAction, { message: '', errors: {}, formData: { title: '', tag: '', content: '', }, success: false, }); useActionState 훅을 사용할 때 initialState 에 포함된 필드 중 일부를 이후 action 함수의 반환값에서 생략하면 어떤 경우에는 에러가 발생하고, 어떤 경우에는 아무 문제 없이 동작하는 게 잘 이해가 되지 않아서요. 예를 들어 initialState 에는 success 필드가 있지만, 유효성 검사 실패 시 반환 객체에서 success 를 생략하면 에러가 발생합니다. if (!validatedFields.success) { return { errors: validatedFields.error.flatten().fieldErrors, message: 'Validation failed', formData: rawFormData, success: false, // 없으면 useActionState 에서 에러 발생 }; } 그런데 try...catch 문에서는 success 없이 반환하면 에러가 발생하지 않는 걸 확인할 수 있었습니다. try { const { title, tag, content } = validatedFields.data; await createPost({ title, tag, content }); revalidateTag('posts'); return { success: true, // 없어도 에러 안남 message: 'Post created successfully', }; } catch (e) { return { message: 'Failed to create post : ' + e, formData: rawFormData, }; } formData 필드도 비슷하게 행동하는데 이 차이가 왜 발생하는지, 어떤 기준으로 반환 객체의 필드 구조를 검사하고 에러를 발생시키는지 궁금합니다. useActionState 에서 반환 객체의 필드가 initialState 와 구조적으로 정확히 일치해야 하는 조건이 언제 적용되는 건가요?
Vue 3 & Firebase 10 커뮤니티 만들기 풀스택 - "활용편" (with Pinia, Quasar, Tiptap, VueUse)
unplugin-vue-router/vite 를 다운받고 공식문서 참고해서 설정했는데 pages의 index.vue가 오토라우팅이 되지않습니다. router.index.js import { defineRouter } from '#q-app/wrappers' import { createRouter, createMemoryHistory, createWebHistory, createWebHashHistory } from 'vue-router/auto' import routes from './routes' /* * If not building with SSR mode, you can * directly export the Router instantiation; * * The function below can be async too; either use * async/await or return a Promise which resolves * with the Router instance. */ export default defineRouter(function (/* { store, ssrContext } */) { const createHistory = process.env.SERVER ? createMemoryHistory : (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory) const Router = createRouter({ scrollBehavior: () => ({ left: 0, top: 0 }), routes, // Leave this as is and make changes in quasar.conf.js instead! // quasar.conf.js -> build -> vueRouterMode // quasar.conf.js -> build -> publicPath history: createHistory(process.env.VUE_ROUTER_BASE) }) return Router }) quasar.config.js // Configuration for your app // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file import VueRouter from 'unplugin-vue-router/vite' import { defineConfig } from '#q-app/wrappers' export default defineConfig((/* ctx */) => { return { // https://v2.quasar.dev/quasar-cli-vite/prefetch-feature // preFetch: true, // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli-vite/boot-files boot: [ ], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css css: [ 'app.scss' ], // https://github.com/quasarframework/quasar/tree/dev/extras extras: [ // 'ionicons-v4', // 'mdi-v7', // 'fontawesome-v6', // 'eva-icons', // 'themify', // 'line-awesome', // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both! 'roboto-font', // optional, you are not bound to it 'material-icons', // optional, you are not bound to it ], // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#build build: { target: { browser: [ 'es2022', 'firefox115', 'chrome115', 'safari14' ], node: 'node20' }, vueRouterMode: 'hash', // available values: 'hash', 'history' // vueRouterBase, // vueDevtools, // vueOptionsAPI: false, // rebuildCache: true, // rebuilds Vite/linter/etc cache on startup // publicPath: '/', // analyze: true, // env: {}, // rawDefine: {} // ignorePublicFolder: true, // minify: false, // polyfillModulePreload: true, // distDir // extendViteConf (viteConf) {}, // viteVuePluginOptions: {}, vitePlugins: [ ['vite-plugin-checker', { eslint: { lintCommand: 'eslint -c ./eslint.config.js "./src*/**/*.{js,mjs,cjs,vue}"', useFlatConfig: true } }, { server: false }, ], // 자동 라우터 플러그인 사용하기 VueRouter({ }), ] }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#devserver devServer: { // https: true, open: true // opens browser window automatically }, // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#framework framework: { config: {}, // iconSet: 'material-icons', // Quasar icon set // lang: 'en-US', // Quasar language pack // For special cases outside of where the auto-import strategy can have an impact // (like functional components as one of the examples), // you can manually specify Quasar components/directives to be available everywhere: // // components: [], // directives: [], // Quasar plugins plugins: [] }, // animations: 'all', // --- includes all animations // https://v2.quasar.dev/options/animations animations: [], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#sourcefiles // sourceFiles: { // rootComponent: 'src/App.vue', // router: 'src/router/index', // store: 'src/store/index', // pwaRegisterServiceWorker: 'src-pwa/register-service-worker', // pwaServiceWorker: 'src-pwa/custom-service-worker', // pwaManifestFile: 'src-pwa/manifest.json', // electronMain: 'src-electron/electron-main', // electronPreload: 'src-electron/electron-preload' // bexManifestFile: 'src-bex/manifest.json // }, // https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr ssr: { prodPort: 3000, // The default port that the production server should use // (gets superseded if process.env.PORT is specified at runtime) middlewares: [ 'render' // keep this as last one ], // extendPackageJson (json) {}, // extendSSRWebserverConf (esbuildConf) {}, // manualStoreSerialization: true, // manualStoreSsrContextInjection: true, // manualStoreHydration: true, // manualPostHydrationTrigger: true, pwa: false // pwaOfflineHtmlFilename: 'offline.html', // do NOT use index.html as name! // pwaExtendGenerateSWOptions (cfg) {}, // pwaExtendInjectManifestOptions (cfg) {} }, // https://v2.quasar.dev/quasar-cli-vite/developing-pwa/configuring-pwa pwa: { workboxMode: 'GenerateSW' // 'GenerateSW' or 'InjectManifest' // swFilename: 'sw.js', // manifestFilename: 'manifest.json', // extendManifestJson (json) {}, // useCredentialsForManifestTag: true, // injectPwaMetaTags: false, // extendPWACustomSWConf (esbuildConf) {}, // extendGenerateSWOptions (cfg) {}, // extendInjectManifestOptions (cfg) {} }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-cordova-apps/configuring-cordova cordova: { // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-capacitor-apps/configuring-capacitor capacitor: { hideSplashscreen: true }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron electron: { // extendElectronMainConf (esbuildConf) {}, // extendElectronPreloadConf (esbuildConf) {}, // extendPackageJson (json) {}, // Electron preload scripts (if any) from /src-electron, WITHOUT file extension preloadScripts: [ 'electron-preload' ], // specify the debugging port to use for the Electron app when running in development mode inspectPort: 5858, bundler: 'packager', // 'packager' or 'builder' packager: { // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options // OS X / Mac App Store // appBundleId: '', // appCategoryType: '', // osxSign: '', // protocol: 'myapp://path', // Windows only // win32metadata: { ... } }, builder: { // https://www.electron.build/configuration/configuration appId: 'vue3-quasar-firebase-app' } }, // Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex bex: { // extendBexScriptsConf (esbuildConf) {}, // extendBexManifestJson (json) {}, /** * The list of extra scripts (js/ts) not in your bex manifest that you want to * compile and use in your browser extension. Maybe dynamic use them? * * Each entry in the list should be a relative filename to /src-bex/ * * @example [ 'my-script.ts', 'sub-folder/my-other-script.js' ] */ extraScripts: [] } } }) 기존의 라우터를 냅두면 MainLayout 으로 가고 주석처리해버리면 빈화면입니다. const routes = [ { path: '/', component: () => import('layouts/MainLayout.vue'), children: [ { path: '', component: () => import('pages/IndexPage.vue') } ] }, // Always leave this as last one, // but you can also remove it { path: '/:catchAll(.*)*', component: () => import('pages/ErrorNotFound.vue') } ] export default routes
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하세요 강사님 오늘 방금 시간으로 RMSE 내용이랑 test.csv 예측칼럼 삭제 확인했는데 혹시 강의 업로드 가능하신지 문의드립니다~
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하세요. 2유형 문제에서 원-핫 인코딩을 진행할 때, 기존에는 train과 test 데이터를 먼저 합친 뒤 pd.get_dummies()를 적용하고, 이후 다시 분리하는 방식으로 학습했었습니다. 그런데 최근 기출문제 풀이를 보면, train과 test를 따로 인코딩하는 경우도 종종 보이더라고요. 혹시 범주의 유니크 값 개수가 동일하다면, 굳이 합치지 않아도 인코딩을 개별적으로 진행해도 무방한 건지 궁금합니다. 인코딩 처리 방식에 대해 혼동이 있어 문의드립니다. 감사합니다.
# 모듈 임포트 import win32com.client as win32 # 한/글 열기 hwp = win32.gencache.EnsureDispatch("hwpframe.hwpobject") hwp.XHwpWindows.Item(0).Visible = True hwp.RegisterModule("FilePathCheckDLL", "FilePathCheckerModule") hwp.Open(r"C:\Users\smj02\Desktop\누름틀필드.hwp") # 엑셀 열기 excel = win32.gencache.EnsureDispatch("Excel.Application") excel.Visible = True wb = excel.Workbooks.Open(r"C:\Users\smj02\Desktop\취미.xlsx") ws = wb.Worksheets(1) # 필드삽입 함수 정의 def 필드삽입(index, value): field_list = ["이름", "성별", "생일", "취미"] for idx, field in enumerate(field_list): hwp.PutFieldText(f"{field}{{{{{index}}}}}", value[idx]) # 첫 쪽 복사 hwp.Run("CopyPage") # while문 실행 row = 2 while True: if not ws.Cells(row, 1).Value: hwp.Run("DeletePage") break else: data = list( ws.Range(ws.Cells(row,1), ws.Cells(row, 4)).Value[0] ) data[2] = data[2].strftime("%Y년 %#m월 %#d일") 필드삽입(row-2, data) hwp.Run("PastePage") row += 1 위 코드를 실행 시켰을때 한글 첫페이지만 아래처럼 생성되고 다음 페이지(빌, 일론 등)가 생성이 안됩니다. 이름 : 마크 성별 : 남 생일 : 1984년 5월 14일 취미 : VR 그대로 복붙해서 했는데 안되서 질문 남깁니다ㅠ 첫 쪽 복사와 붙여넣기가 안먹는거 같은데 이상하네요
12:58 2번 문제에서 앞의 부분, 데이터에서 'solar'와 'o3'를 고정한 상태에서 'wind'의 세기가 증가함에 따라~~ 이 부분은 무시해도 되는건가요?? wind의 p-val 값은 구할 수 있는데 풀이 당시 앞부분의 의미를 몰라서 무엇을 구해야 할지 몰랐었습니다..
from sklearn.ensemble import RandomForestClassifier model = RandomForestClassifier(random_state= 0 ) model.fit (X_tr,y_tr) pred = model.predict(X_val) f1_socre = f1_score(y_val,pred,average= 'macro' ) print (f1_score) 로 작성했더니 <function f1_score at 0x7cb537c5f6a0>로 출력이 되는데 이건 무슨 값일까요? 어떻게 해야 선생님처럼 값이 나올까요>