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

質問編集履歴

1

バグ内容の追加

2021/11/12 13:41

投稿

ririripon
ririripon

スコア2

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,23 @@
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
6
 
7
+ Discordのチャットにて
8
+ Traceback (most recent call last):
9
+ File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
10
+ ret = await coro(*args, **kwargs)
11
+ File "discordbot.py", line 43, in allrandom7
12
+ await ctx.send(df.iloc[r,0])
13
+ File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/indexing.py", line 925, in getitem
14
+ return self._getitem_tuple(key)
15
+ File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/indexing.py", line 1506, in _getitem_tuple
16
+ self._has_valid_tuple(tup)
17
+ File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/indexing.py", line 754, in _has_valid_tuple
18
+ self._validate_key(k, i)
19
+ File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/indexing.py", line 1409, in _validate_key
20
+ self._validate_integer(key, axis)
21
+ File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/indexing.py", line 1500, in _validate_integer
22
+ raise IndexError("single positional indexer is out-of-bounds")
23
+ IndexError: single positional indexer is out-of-bounds
7
24
 
8
25
 
9
26
  ### 該当のソースコード
@@ -26,13 +43,10 @@
26
43
 
27
44
  bot = commands.Bot(command_prefix='/')
28
45
 
29
- #with open("word.csv", "r") as f:
30
- #reader = csv.reader(f)
31
- #header = next(reader) # ヘッダを読み飛ばす
32
- #for row in reader: # 1 行ずつ文字列のリストとして読み
33
46
 
34
47
 
35
48
 
49
+
36
50
  @bot.event
37
51
  async def on_command_error(ctx, error):
38
52
  orig_error = getattr(error, "original", error)