前提・実現したいこと
urlを見ましたがエラーコードの解決方法がわかりません。
https://signate.jp/competitions/1/dataのデータ分析をanacondaにて行なっていました。
発生している問題・エラーメッセージ
2つ目のコードに対するエラー /anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:4: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy after removing the cwd from sys.path. 3つ目のコードに対するエラー /anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:5: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy """ /anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:7: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy import sys
該当のソース
python
1#Agegroup作成部分です 2bins=[23,40,60,80,np.inf] 3labels=['Young','Adult','Senior','Older'] 4train['AgeGroup']=pd.cut(train['age'],bins,labels=labels) 5test['AgeGroup']=pd.cut(test['age'],bins,labels=labels) 6train.head()
python
1for x in range(len(train["job"])): 2 if pd.isnull(train["job"][x]): 3 agegroup=train['AgeGroup'][x] 4 train['job'][x]=train[train['AgeGroup']==agegroup]["job"].mode()
python
1 for x in range(len(train["contact"])): 2 if pd.isnull(train["contact"][x]): 3 count=train['campaign'][x] 4 if count > 2: 5 train['contact'][x]="telephone" 6 else: 7 train['contact'][x]="cellular"
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。