質問編集履歴

4

修正

2023/01/29 04:47

投稿

giagany
giagany

スコア3

test CHANGED
File without changes
test CHANGED
@@ -17,11 +17,11 @@
17
17
  import numpy as np
18
18
  import pandas as pd
19
19
 
20
- df = pd.read_csv('.data.csv',encoding='cp932')
20
+ df = pd.read_csv('data.csv',encoding='cp932')
21
21
  pd.set_option('display.max_rows', 150)
22
22
  pd.set_option('display.max_columns', None)
23
23
  pd.set_option('display.max_colwidth', None)
24
- pd.read_csv('.data.csv',encoding='cp932')
24
+ pd.read_csv('data.csv',encoding='cp932')
25
25
 
26
26
 
27
27
 

3

修正

2023/01/29 04:26

投稿

giagany
giagany

スコア3

test CHANGED
File without changes
test CHANGED
@@ -7,7 +7,7 @@
7
7
  ### 発生している問題・エラーメッセージ
8
8
 
9
9
  ```
10
- invalid syntax
10
+ The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
11
11
  ```
12
12
 
13
13
  ### 該当のソースコード
@@ -28,8 +28,8 @@
28
28
  row_1st = df.iloc[0,0]
29
29
 
30
30
 
31
- num = int(input('数値を入力してください:'))
31
+ num = int(input())
32
- if row_1st - 1 <= num <= row_1st + 1
32
+ if row_1st - 1 <= num <= row_1st + 1:
33
33
  print('9以上かつ11以下です。')
34
34
 
35
35
  else: print('9以上かつ11以下ではありません。')
@@ -52,8 +52,8 @@
52
52
  #10
53
53
 
54
54
 
55
- num = int(input('数値を入力してください:'))
55
+ num = int(input())
56
- if **row_1st - 1** <= num <= **row_1st + 1**
56
+ if **row_1st - 1** <= num <= **row_1st + 1**:
57
57
  print('9以上かつ11以下です。')
58
58
  else:
59
59
  print('9以上かつ11以下ではありません。')

2

修正

2023/01/29 02:21

投稿

giagany
giagany

スコア3

test CHANGED
File without changes
test CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
 
27
27
 
28
- row_1st = df.iloc[[0],[0]]
28
+ row_1st = df.iloc[0,0]
29
29
 
30
30
 
31
31
  num = int(input('数値を入力してください:'))
@@ -47,7 +47,7 @@
47
47
 
48
48
  ### 実行結果
49
49
 
50
- row_1st = df.iloc[[0],[0]]
50
+ row_1st = df.iloc[0,0]
51
51
 
52
52
  #10
53
53
 

1

修正

2023/01/29 02:18

投稿

giagany
giagany

スコア3

test CHANGED
File without changes
test CHANGED
@@ -25,11 +25,11 @@
25
25
 
26
26
 
27
27
 
28
- row_1th = df.iloc[[0],[0]]
28
+ row_1st = df.iloc[[0],[0]]
29
29
 
30
30
 
31
31
  num = int(input('数値を入力してください:'))
32
- if row_1th - 1 <= num <= row_1th + 1
32
+ if row_1st - 1 <= num <= row_1st + 1
33
33
  print('9以上かつ11以下です。')
34
34
 
35
35
  else: print('9以上かつ11以下ではありません。')
@@ -47,13 +47,13 @@
47
47
 
48
48
  ### 実行結果
49
49
 
50
- row_1th = df.iloc[[0],[0]]
50
+ row_1st = df.iloc[[0],[0]]
51
51
 
52
52
  #10
53
53
 
54
54
 
55
55
  num = int(input('数値を入力してください:'))
56
- if **row_1th - 1** <= num <= **row_1th + 1**
56
+ if **row_1st - 1** <= num <= **row_1st + 1**
57
57
  print('9以上かつ11以下です。')
58
58
  else:
59
59
  print('9以上かつ11以下ではありません。')
@@ -67,7 +67,7 @@
67
67
 
68
68
  (+1またはー1は例です)
69
69
 
70
- **row_1th - 1**のように+またはーされた値で数値を判別させたい。
70
+ **row_1st - 1**のように+またはーされた値で数値を判別させたい。
71
71
 
72
72
 
73
73