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

質問編集履歴

2

誤字訂正

2020/07/29 06:23

投稿

o-fk
o-fk

スコア32

title CHANGED
File without changes
body CHANGED
@@ -35,8 +35,6 @@
35
35
  import pandas as pd
36
36
  from matplotlib import pyplot as plt
37
37
 
38
-
39
-
40
38
  df = pd.read_csv('KKtest81.csv',encoding="utf-8",header=0)
41
39
 
42
40
  df["Time"] = pd.to_datetime(df["Time"])
@@ -56,11 +54,6 @@
56
54
 
57
55
  plt.show()
58
56
 
59
-
60
-
61
-
62
-
63
-
64
57
  ```
65
58
 
66
59
 

1

utf-8、ファイル指定、エラーコードを更新しました。

2020/07/29 06:23

投稿

o-fk
o-fk

スコア32

title CHANGED
File without changes
body CHANGED
@@ -33,13 +33,12 @@
33
33
  ```
34
34
  ```ここに言語を入力
35
35
  import pandas as pd
36
- import matplotlib.pyplot as plt
36
+ from matplotlib import pyplot as plt
37
- import matplotlib.dates as mdates
38
- import datetime
39
37
 
40
38
 
41
- df = pd.read_csv('C:\Users\AK\Documents\Ktemp\KKtest81.csv',encoding="shift_jis",header=0)
42
39
 
40
+ df = pd.read_csv('KKtest81.csv',encoding="utf-8",header=0)
41
+
43
42
  df["Time"] = pd.to_datetime(df["Time"])
44
43
 
45
44
  start_datetime = df.iloc[0]["Time"]
@@ -49,26 +48,26 @@
49
48
  df.plot()
50
49
 
51
50
  ## 気温グラフ
52
- plt.title('Temperature Aug_01 @K')
51
+ plt.title('Temperature Aug_01 @Kanagawa')
53
52
  plt.xlabel('Time')
54
53
  plt.ylabel('Temperature[℃]')
55
54
  plt.grid(axis='y',c='gainsboro', zorder=9)
56
- plt.savefig('C:\Users\AK\Documents\Ktemp\KK8.1.png', bbox_inches="tight")
55
+ plt.savefig('KK8.1.png', bbox_inches="tight")
57
56
 
58
57
  plt.show()
59
58
 
60
59
 
60
+
61
+
62
+
63
+
61
64
  ```
62
65
 
63
66
 
64
67
 
65
68
  エラー
66
69
  ```ここに言語を入力
67
- File "C:\Users\AK\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
70
+ ValueError: view limit minimum -36854.182916666665 is less than 1 and is an invalid Matplotlib date value. This often happens if you pass a non-datetime value to an axis that has datetime units
68
- exec(compile(f.read(), filename, 'exec'), namespace)
69
71
 
70
- File "C:/Users/AK/Documents/Ktemp/temp.py", line 15
72
+ <Figure size 432x288 with 1 Axes>
71
- df = pd.read_csv('C:\Users\AK\Documents\Ktemp\KKtest81.csv',encoding="shift_jis",header=0)
72
- ^
73
- SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
74
73
  ```