inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

boxcox를 변환하는 코드 에

미해결

[비전공자 대환영] 제로베이스도 쉽게 입문하는 파이썬 데이터 분석 - 캐글입문기

from scipy.special import boxcox1p from scipy.stats import boxcox_normmax # 왜도가 1보다 높은 수치형 변수를 출력하는 코드 high_skew = skewness_features[skewness_features > 1] high_skew_index = high_skew.index print("The data before Box-Cox Transformation: \n", all_df[high_skew_index].head()) # boxcox를 변환하는 코드 for num_var in high_skew_index: all_df[num_var] = boxcox1p(all_df[num_var], boxcox_normmax(all_df[num_var] + 1)) print("The data after Box-Cox Transformation: \n", all_df[high_skew_index].head()) 위와 같이 코드를 실행시켰을 때 다음과 같은 에러가 발생하였습니다. <ipython-input-72-7b0af0216c6e> in <cell line: 11>() 10 # boxcox를 변환하는 코드 11 for num_var in high_skew_index: ---> 12 all_df[num_var] = boxcox1p(all_df[num_var], boxcox_normmax(all_df[num_var] + 1)) 13 14 print("The data after Box-Cox Transformation: \n", all_df[high_skew_index].head()) BracketError: The algorithm terminated without finding a valid bracket. Consider trying different initial points.

  • python
  • 머신러닝
  • pandas
  • numpy
  • kaggle
  • scikit-learn
  • matplotlib
박호영 댓글 2 좋아요 0 조회수 822

shift tab 으로 도움말이 안나타납니다 ㅜ

미해결

공공데이터로 파이썬 데이터 분석 시작하기

안녕하세요 shift tab 으로 도움말이 안나타납니다. 아래 답변주신 내용중에 ? 후 코드 실행후 다시 해보면 될거라는 답변을 해주셔서 그대로 해봤는데도 되지 않습니다. 혹시 다른 방법이 있을까요?

  • python
  • pandas
  • numpy
donghyun6.kim 댓글 2 좋아요 0 조회수 987

5번챕터 판다스프로파일링 업데이트 관련

미해결

공공데이터로 파이썬 데이터 분석 시작하기

안녕하세요 챕터5 도시공원관련 강의 학습중인데요 판다스 프로파일링 설치 및 폰트 변경완료 하였는데 하기와 같은 에러가 계속 발생하고 있습니다. 강의 내용대로 동일하게 하였는데 전혀다른 내용의 에러가 발생하여 이부분 문의드립니다. -- 에러내용 PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.4/migration/#basesettings-has-moved-to-pydantic-settings for more details. For further information visit https://errors.pydantic.dev/2.4/u/import-error 확인부탁드립니다.

  • python
  • pandas
  • numpy
badboy91 댓글 1 좋아요 0 조회수 544

dtype={"itemcode": np.object}) 을 dtype={"itemcode": object}) 으로 변경해야 하나요?

미해결

파이썬 증권 데이터 수집과 분석으로 신호와 소음 찾기

예전에 잘 들었다가 최근에 다시 들으면서 실행하니, numpy dtype관련사항이 변경(업데이트)가 있었는지 numpy 1.20이후 변경되었다고 알람,오류메세지가 발생합니다. np.object 부분에서 np. 을 빼고 실행하면 되는데 이렇게 진행하면 될까요? 본 섹션 이외에도 np.object를 string으로 입력받기 위해 사용된 곳이 몇몇 보이는데 해당부분도 동일하게 object(찾아보니 python default type 같습니다만, 정확히 알지 못하겠습니다.) 로 변경해서 사용하면 크게 문제가 없을까요? 시간이 지났지만 자세하고 하나씩 설명해 주셔서 감사합니다.

  • python
  • pandas
  • numpy
  • 웹-크롤링
  • seaborn
  • plotly
  • matplotlib
  • 웹-스크래핑
브루브루 댓글 1 좋아요 0 조회수 639

상가상권정보 파일 부재

미해결

공공데이터로 파이썬 데이터 분석 시작하기

안녕하세요 상가정보데이터셋 처음부분 보고 있는데 공유된 링크에서 다운받으려고 보니 데이터셋이 "_01.csv"밖에 없습니다. (영상에는 4개의 파일이 있어야함) 공공데이터포털로 직접 들어가서 찾아보니 2019년 12월 데이터가 보이지 않아 문의드립니다.

  • python
  • pandas
  • numpy
badboy91 댓글 1 좋아요 0 조회수 261

swarmplot 에러발생 도와주세요~

미해결

공공데이터로 파이썬 데이터 분석 시작하기

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 좋은강의 감사드립니다. 19강에서 연도별 평당분양가격 swarmplot그리는 코드실행시 오류가 발생합니다. 어떻게 해결하면 될까요. <에러> ValueError: cannot reindex on an axis with duplicate labels <코드> # 연도별 평당분양가격 swarmplot 그리기 plt.figure(figsize=(12,3)) sns.swarmplot(data=df, x="연도", y="평당분양가격", hue='지역명') plt.legend(bbox_to_anchor=(1.02,1), loc=2, borderaxespad=0.)

  • python
  • pandas
  • numpy
Jake Seo 댓글 1 좋아요 0 조회수 373

shift + tab 눌러도 아무 반응이 없습니다.

미해결

공공데이터로 파이썬 데이터 분석 시작하기

Nbextensions 에서 뭔가 추가를 해줘야 하는건가요?

  • python
  • pandas
  • numpy
bi.yang 댓글 1 좋아요 0 조회수 252

LeNet-5 실습 중 loss값 nan이 나오고 있습니다.

해결됨

파이썬을 활용한 머신러닝 딥러닝 입문

강의와 동일하게 코드를 쳐서 진행한 것 같은데 loss값 자체가 nan이 나오고 accuracy는 0.1을 넘기지 못하는 중입니다. 왜 이렇게 나오는 건지 알려주실 수 있을까요?

  • python
  • 머신러닝
  • 딥러닝
  • pandas
  • numpy
  • keras
  • tensorflow
  • anaconda
  • matplotlib
  • cnn
MR.SONOB 댓글 1 좋아요 0 조회수 672

nb extensions의 table of contents 오류 문의

미해결

공공데이터로 파이썬 데이터 분석 시작하기

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 강사님, nbextensions 설치하여 Files - Running - Clusters 옆 탭에 정상적으로 nbextensions가 표기되긴 합니다만, 문서 내 contents 탭을 누르면 흰색 공간만 뜨고 안에 목차가 표시되지 않습니다. 해결방법을 찾고 싶습니다. (혹시) 아래 두 번째 이미지의 노란 박스 내용이 여러 버전의 파일이 설치되어 있어 정상적으로 작동하지 않을 수 있다는 메시지 같은데, 아나콘다 터미널에서 해봤는데 되지 않아서, 쥬피터 문서에서도 돌려봤었는데요. 이것과 연관이 있는 걸까요? 위 이슈가 아니더라도, 해결방법 아시면 답글 부탁드리겠습니다.

  • python
  • pandas
  • numpy
khan 댓글 1 좋아요 0 조회수 287

레몬에이드 데이터 자료에 없습니다

미해결

[비전공자 대환영] 제로베이스도 쉽게 입문하는 파이썬 데이터 분석 - 캐글입문기

강의자료에 레몬에이드 파일이 없는데 어디서 다운받아야 하나요

  • python
  • 머신러닝
  • pandas
  • numpy
  • kaggle
  • scikit-learn
  • matplotlib
ritae 댓글 1 좋아요 0 조회수 434

(해결) Unexpected Character

미해결

공공데이터로 파이썬 데이터 분석 시작하기

해결완료 해당 사진에서font_path 에서 Windows 앞글자를 소문자로 해서 났던 오류인가 싶습니다 (당시에는 대소문자 관게없이 같은 오류가 났어요) 검색해보니 워드클라우드에서 지원하는 폰트가 있고 아닌 폰트가 있다는것 같더라고요 font_path='malgun' 라고 써주거나 기본폰트중 하나인 'HY동녘M 보통'을 사용하여 font_path="C:\Windows\Fonts\HYDNKM.TTF" 라고 써주니 해결되었습니다

  • python
  • pandas
  • numpy
댓글 2 좋아요 0 조회수 337

(수정) Seaborn으로 히트맵 그릴 때 문제해결 공유합니다

미해결

공공데이터로 파이썬 데이터 분석 시작하기

sns.heatmap에서 100 이상의 수가 깨지는 현상이 발생합니다 해결방법 year_month_new = year_month.round(0).astype(int) sns.heatmap(data=year_month_new, cmap="Blues", annot=True, fmt="d")

  • python
  • pandas
  • numpy
다라라람쥐 댓글 1 좋아요 0 조회수 911

(해결완료)아나콘다 재설치후 missingno 작동이 안됩니다

미해결

공공데이터로 파이썬 데이터 분석 시작하기

(해결책)아나콘다 재설치시 마지막 체크박스에 이전 설정기록을 다 삭제하도록 꼭 체크하셔야 아나콘다 재설치 후에 탈이 없습니다!! 어제 질문드린 판다스 프로파일링 문제를 겪으면서 아나콘다를 두어번 재설치하는 과정에서 missingno까지 꼬여버린 것 같습니다 프롬프트 관리자 환경에서 설치를 마쳤음에도 missingno 실행이 안됩니다.. 2번째 수업(missingno를 처음 다뤘던 수업)에서 했던 파일을 돌려보아도 마찬가지입니다 일단은 프로파일링과 미싱노를 건너띄고 수업을 진행할 예정입니다!!

  • python
  • pandas
  • numpy
댓글 1 좋아요 0 조회수 433

판다스 프로파일링 호출이 안됩니다

미해결

공공데이터로 파이썬 데이터 분석 시작하기

해당 주소에 판다스 프로파일링이 버전별로 있는데 첨부한 코드와 같이 오류가 납니다.. 다른분들의 질문글을 읽어보고 판다스 버전도 바꿔보고 프로파일링 버전도 바꿔보고, 아나콘다 재설치도 두어번 해봤는데 도저히 해결책을 못찾겠어요.. (아나콘다 재설치 과정에서 주피터와 프롬프트가 사라지기도 해서 애를 많이 먹었습니다ㅠㅠ) ipynb 파일 https://drive.google.com/file/d/1bd4wdrlwevN5FneKN_fWRrDkl2q8zniY/view?usp=sharing base.py https://drive.google.com/file/d/1GcxiAhg_XTW2V5h35fnEkxmZQCYIx1YJ/view?usp=sharing

  • python
  • pandas
  • numpy
다라라람쥐 댓글 1 좋아요 0 조회수 306

지도가 갑자기 까맣게 칠해집니다..

미해결

공공데이터로 파이썬 데이터 분석 시작하기

안녕하세요 9/9강 1분20초까지 따라하던 중에 지도가 까맣게 칠해지는데 이유를 못찾겠습니다 바로 이전에 그린 지도에서는 아무 문제가 없습니다 df_vs를 output 소스코드와 비교해봐도 이상이 없습니다 그런데 갑자기 지도의 일부가 까맣게 칠해지네요.. 40분간 검수하고 다시 돌려보고 선생님 소스코드를 붙여넣기 해봐도 원인을 찾지 못해 질문드립니다 https://drive.google.com/file/d/1XH-qxc1iBOmgBE9UXCMSgzxMYxle0oqp/view?usp=drive_link 파일의 04.스벅_이디야 파일을 봐주시면 됩니다

  • python
  • pandas
  • numpy
다라라람쥐 댓글 3 좋아요 0 조회수 465

강의

미해결

공공데이터로 파이썬 데이터 분석 시작하기

코렙에서 해도 괜찮나요?

  • python
  • pandas
  • numpy
bada6517 댓글 1 좋아요 0 조회수 291

2023 버전

미해결

공공데이터로 파이썬 데이터 분석 시작하기

새로 출시된 버전으로 사용해도 문제 없나요?

  • python
  • pandas
  • numpy
bada6517 댓글 1 좋아요 0 조회수 352

[17/20] 5:30~ concat 오류

미해결

공공데이터로 파이썬 데이터 분석 시작하기

합치기 전 데이터프레임이 강의와 같이 잘 완성되었는데 concat에서 오류가 납니다 한번 봐주세요!!!

  • python
  • pandas
  • numpy
다라라람쥐 댓글 2 좋아요 0 조회수 361

cleaning함수를 작성해서 데이터를 추리는 이유는 무엇인가요?

미해결

제주 하간디 이신 데이터들 Python으로 몬딱 분석해불게

제주지역에 해당하는 데이터만 뽑는 과정을 def cleaning(location): if location == '제주': return location else: return np.nan 로 하셨는데, raw_log[raw_log['지역(시도)']=='제주'].reset_index(drop=True) 로 하면 안되나요? 혹시 함수를 작성하는 경우가 메모리 상에서 좀 더 효율적인건가요?

  • pandas
  • numpy
  • seaborn
  • plotly
  • matplotlib
  • 데이터-엔지니어링
박예빈 댓글 1 좋아요 0 조회수 344

Swarmplot 에러

미해결

공공데이터로 파이썬 데이터 분석 시작하기

강의 회차 : [20/20] 지역별 분양가를 시각화하고 정리하기 질문 : 마지막 시각화 단계에서, boxplot, boxenplot, violinplot 다 잘 구현되는데 swarmplot만 계속 에러가 납니다. 구글에서 에러메시지 검색도 해 봤는데, 잘 해결이 안되네요.. 확인해 주실 수 있으신가요. * 에러메시지도 함께 첨부드립니다. --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[307], line 2 1 plt.figure(figsize=(24, 7)) ----> 2 sns.swarmplot(df, x='지역명', y='평당분양가격') File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:2664, in swarmplot(data, x, y, hue, order, hue_order, dodge, orient, color, palette, size, edgecolor, linewidth, hue_norm, native_scale, formatter, legend, warn_thresh, ax, **kwargs) 2657 linewidth = size / 10 2659 kwargs.update(dict( 2660 s=size ** 2, 2661 linewidth=linewidth, 2662 )) -> 2664 p.plot_swarms( 2665 dodge=dodge, 2666 color=color, 2667 edgecolor=edgecolor, 2668 warn_thresh=warn_thresh, 2669 plot_kws=kwargs, 2670 ) 2672 p._add_axis_labels(ax) 2673 p._adjust_cat_axis(ax, axis=p.cat_axis) File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:330, in _CategoricalPlotterNew.plot_swarms(self, dodge, color, edgecolor, warn_thresh, plot_kws) 321 def plot_swarms( 322 self, 323 dodge, (...) 327 plot_kws, 328 ): --> 330 width = .8 * self._native_width 331 offsets = self._nested_offsets(width, dodge) 333 iter_vars = [self.cat_axis] File ~/anaconda3/lib/python3.10/site-packages/seaborn/categorical.py:229, in _CategoricalPlotterNew._native_width(self) 226 @property 227 def _native_width(self): 228 """Return unit of width separating categories on native numeric scale.""" --> 229 unique_values = np.unique(self.comp_data[self.cat_axis]) 230 if len(unique_values) > 1: 231 native_width = np.nanmin(np.diff(unique_values)) File ~/anaconda3/lib/python3.10/site-packages/seaborn/_oldcore.py:1134, in VectorPlotter.comp_data(self) 1132 else: 1133 comp_col = pd.Series(dtype=float, name=var) -> 1134 comp_data.insert(0, var, comp_col) 1136 self._comp_data = comp_data 1138 return self._comp_data File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:4786, in DataFrame.insert(self, loc, column, value, allow_duplicates) 4783 if not isinstance(loc, int): 4784 raise TypeError("loc must be int") -> 4786 value = self._sanitize_column(value) 4787 self._mgr.insert(loc, column, value) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:4877, in DataFrame._sanitize_column(self, value) 4875 return _reindex_for_setitem(value, self.index) 4876 elif is_dict_like(value): -> 4877 return _reindex_for_setitem(Series(value), self.index) 4879 if is_list_like(value): 4880 com.require_length_match(value, self.index) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:11620, in _reindex_for_setitem(value, index) 11616 except ValueError as err: 11617 # raised in MultiIndex.from_tuples, see test_insert_error_msmgs 11618 if not value.index.is_unique: 11619 # duplicate axis > 11620 raise err 11622 raise TypeError( 11623 "incompatible index of inserted column with frame index" 11624 ) from err 11625 return reindexed_value File ~/anaconda3/lib/python3.10/site-packages/pandas/core/frame.py:11615, in _reindex_for_setitem(value, index) 11613 # GH#4107 11614 try: > 11615 reindexed_value = value.reindex(index)._values 11616 except ValueError as err: 11617 # raised in MultiIndex.from_tuples, see test_insert_error_msmgs 11618 if not value.index.is_unique: 11619 # duplicate axis File ~/anaconda3/lib/python3.10/site-packages/pandas/core/series.py:4914, in Series.reindex(self, index, axis, method, copy, level, fill_value, limit, tolerance) 4897 @doc( 4898 NDFrame.reindex, # type: ignore[has-type] 4899 klass=_shared_doc_kwargs["klass"], (...) 4912 tolerance=None, 4913 ) -> Series: -> 4914 return super().reindex( 4915 index=index, 4916 method=method, 4917 copy=copy, 4918 level=level, 4919 fill_value=fill_value, 4920 limit=limit, 4921 tolerance=tolerance, 4922 ) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/generic.py:5360, in NDFrame.reindex(self, labels, index, columns, axis, method, copy, level, fill_value, limit, tolerance) 5357 return self._reindex_multi(axes, copy, fill_value) 5359 # perform the reindex on the axes -> 5360 return self._reindex_axes( 5361 axes, level, limit, tolerance, method, fill_value, copy 5362 ).__finalize__(self, method="reindex") File ~/anaconda3/lib/python3.10/site-packages/pandas/core/generic.py:5375, in NDFrame._reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy) 5372 continue 5374 ax = self._get_axis(a) -> 5375 new_index, indexer = ax.reindex( 5376 labels, level=level, limit=limit, tolerance=tolerance, method=method 5377 ) 5379 axis = self._get_axis_number(a) 5380 obj = obj._reindex_with_indexers( 5381 {axis: [new_index, indexer]}, 5382 fill_value=fill_value, 5383 copy=copy, 5384 allow_dups=False, 5385 ) File ~/anaconda3/lib/python3.10/site-packages/pandas/core/indexes/base.py:4274, in Index.reindex(self, target, method, level, limit, tolerance) 4271 raise ValueError("cannot handle a non-unique multi-index!") 4272 elif not self.is_unique: 4273 # GH#42568 -> 4274 raise ValueError("cannot reindex on an axis with duplicate labels") 4275 else: 4276 indexer, _ = self.get_indexer_non_unique(target) ValueError: cannot reindex on an axis with duplicate labels

  • python
  • pandas
  • numpy
Lucy 댓글 1 좋아요 1 조회수 572

인기 태그

인프런 TOP Writers

주간 인기글