質問するログイン新規登録

質問編集履歴

2

表と合っていない記述があったので変更しました。

2021/04/16 05:24

投稿

makurintan_0415
makurintan_0415

スコア3

title CHANGED
File without changes
body CHANGED
@@ -44,9 +44,9 @@
44
44
  sl = df.iloc[:,[33]] #'金額'のある列
45
45
 
46
46
  for i in df.iterrows():
47
- if (cd==7777001):
47
+ if (cd==5555):
48
48
  df.insert(34,"出張費",sl)
49
- elif (cd==7777002):
49
+ elif (cd==6666):
50
50
  df.insert(35,"接待費",sl)
51
51
  else:
52
52
  df.insert(36,"雑費",sl)

1

例に挙げた列番号が同じところがあったので修正しました

2021/04/16 05:24

投稿

makurintan_0415
makurintan_0415

スコア3

title CHANGED
File without changes
body CHANGED
@@ -41,7 +41,7 @@
41
41
  df = pd.read_excel('sortdataei12.xlsx',sheet_name = 'Sheet1')
42
42
 
43
43
  cd = df.iloc[:,[32]] #'金額コード'のある列
44
- sl = df.iloc[:,[34]] #'金額'のある列
44
+ sl = df.iloc[:,[33]] #'金額'のある列
45
45
 
46
46
  for i in df.iterrows():
47
47
  if (cd==7777001):