728x90 전체 글43 [Jupyter Notebook] TypeError: barplot() got multiple values for argument 'data' 아래는 제목의 오류를 가져오게 한 코드와 오류 내용이다. #그래프 크기 설정 plt.figure(figsize = (14, 5)) # 바 그래프 그리기 (x축 = Age_cat, y축 = Survived) sns.barplot('Age_cat', 'Survived', data = titanic) # 그래프 나타내기 plt.show() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [37], line 5 2 plt.figure(figsize = (14, 5)) 4 # 바 그래프 그리기 (x축 = Age_cat, y축 = Sur.. Python 2022. 12. 6. SpartaCodingClub - 금융인을 위한 파이썬 업무자동화 25기 ◎ 0주차 강의명: 금융인을 위한 파이썬 업무자동화 25기 기간: 2022년 11월 21일 (월) ~ 2022년 12월 26일 (월), 총 5주 완주할 수 있기를... ◎ 1주차 Google Colaboratory (Colab) ⇒ 구글 계정으로 로그인 필요!!! Welcome To Colaboratory Run, share, and edit Python notebooks colab.research.google.com !pip install bs4 requests 입력하여 설치 !pip install openpyxl 입력하여 설치 1주차에서 순차적으로 사용한 import 구문들 import requests from bs4 import BeautifulSoup from openpyxl import Work.. Novice Developer 2022. 12. 1. [Jupyter Notebook] ValueError: Cannot set a DataFrame with multiple columns to the single column ma2 먼저 제목의 오류 발생하기 전 코드와 결과이다. from pandas_datareader import data as pdr import yfinance as yf yf.pdr_override() import numpy as np import pandas as pd import FinanceDataReader as fdr df = fdr.DataReader('005930', '2018') df = df[['Close']].copy() df['ma1'] = df.rolling(3).mean().shift(1) df 제목의 오류가 발생한 코드이다. 1 from pandas_datareader import data as pdr 2 3 import yfinance as yf 4 yf.pdr_override() 5.. Python 2022. 11. 28. [Jupyter Notebook] ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected. 오류 원문이다. ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected. 저 오류는 필요한 패키지를 설치하지 않아 발생하는 오류이다. 따라서 해당 패키지를 설치하면 오류는 사라진다. !pip install matplotlib 입력하여 설치 Python 2022. 11. 26. [Jupyter Notebook] ValueError: If using all scalar values, you must pass an index 오류 원문이다. ValueError: If using all scalar values, you must pass an index 제목의 오류를 유발한 코드는 아래와 같다. corp_code = df_listed[df_listed['corp_name'] == '카카오'].iloc[0,0] data = dart_fss.api.info.emp_sttus(corp_code, '2021', '11011') df = pd.DataFrame(data['list']) df = df[['corp_code', 'corp_name', 'sexdstn', 'jan_salary_am']] #df doc = { '기업명': df['corp_name'][0], '연봉(남)': df[df['sexdstn'] == '남'].iloc[.. Python 2022. 11. 26. [Jupyter Notebook] ValueError: Unable to parse string "-" at position 78 오류 원문이다. ValueError: Unable to parse string "-" at position 78 제목의 오류(ValueError: Unable to parse string "-" at position 78)를 불러온 구문은 아래와 같으며 행 번호로는 14번 행이다. 1 import numpy as np 2 3 corp_code = df_listed[df_listed['corp_name'] == '카카오'].iloc[0, 0] 4 data = dart_fss.api.info.hyslr_sttus(corp_code, '2021', '11011', api_key = None) 5 6 df = pd.DataFrame(data['list']) 7 df = df[['corp_name', 'nm', .. Python 2022. 11. 26. [Jupyter Notebook] AttributeError: module 'collections' has no attribute 'MutableMapping' 오류 원문이다. AttributeError: module 'collections' has no attribute 'MutableMapping' [Jupyter Notebook] ImportError: cannot import name 'MutableSet' from 'collections' (/usr/lib/python3.10/collections/__init__.py) 글 내용 적용하고 바로 맞닥트린 오류이다. 물론 코드는 동일하다. File ~/.local/lib/python3.10/site-packages/arelle/pyparsing/pyparsing_py3.py:627 624 def __dir__(self): 625 return dir(super(ParseResults,self)) + self... Python 2022. 11. 25. [Jupyter Notebook] ImportError: cannot import name 'MutableSet' from 'collections' (/usr/lib/python3.10/collections/__init__.py) Open DART API 사용을 하려고 API Key 신청하고 Jupyter Notebook .ipynb 파일에서 !pip install dart-fss 명령으로 관련 패키지를 설치한 후 아래와 같이 코드를 작성하고 실행했더니 바로 오류를 뿜었다. 참고로 설치된 Python 버전은 3.10.6이다. import dart_fss as dart_fss import pandas as pd api_key = '35f464ee744a0ce5247ac14b25f277a8c5fa7d3a' dart_fss.set_api_key(api_key = api_key) corp_list = dart_fss.get_corp_list() corp_list.corps 그리고 오류 내용은 아래와 같다. File ~/.local/lib.. Python 2022. 11. 25. [Jupyter Notebook] FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. (후략) 제목과 같은 Warning 메시지를 확인한 코드는 아래와 같다. import pandas as pd data = { 'name' : ['영수','철수','영희','소희'], 'age' : [20,15,38,8] } df = pd.DataFrame(data) doc = { 'name':'세종', 'age':14, } df = df.append(doc,ignore_index=True) df 상기 코드로 발생한 Warning 메시지 원문은 아래와 같다. FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. df = df.appe.. Python 2022. 11. 25. [Jupyter Notebook] SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.Try using .loc[row_indexer,col_indexer] = value instead (후략) 앞서 작성했던, [Jupyter Notebook] FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead. new_df = df[{'name', 'current_price'}] 글에 이어 작업하다 나타난 Warning 메시지이다. 일단 전체 Warning 메시지는 아래와 같다. SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveat.. Python 2022. 11. 24. [Jupyter Notebook] FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead. new_df = df[{'name', 'current_price'}] Pandas 모듈을 import pandas as pd 선언으로 불러온 후 앞선 작업으로 생성했던 DataFrame에서 new_df = df[{'name', 'current_price'}] 입력하고 확인하기 위해 new_df 입력 후 Crtl + Enter 실행하니 제목과 같은 Warning 메시지가 나타났다. FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead. new_df = df[{'name', 'current_price'}] 메시지를 보니 df[{'name', 'current_price'}] Syntax는 더 이상 유지보수 되지 않는다는 (deprec.. Python 2022. 11. 24. SpartaCodingClub - 웹개발의 봄, Spring 90기 ◎ 0주차 강의명: 웹개발의 봄, Spring 90기 기간: 2022년 11월 07일 (월) ~ 2022년 12월 12일 (월), 총 5주 완주할 수 있기를... ◎ 1주차 IntelliJ IDEA Ultimate Download Download IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains Download the latest version of IntelliJ IDEA for Windows, macOS or Linux. www.jetbrains.com azul Java 8 JDKs Download (Java Version: Java 8 (LTS), Operating System: 해당하는 OS, Architecture: x86 64bit, .. Novice Developer 2022. 11. 22. 이전 1 2 3 4 다음 💲 추천 글 반응형 SMALL