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

質問編集履歴

2

BAのcode

2020/02/19 13:07

投稿

Danrussia
Danrussia

スコア44

title CHANGED
File without changes
body CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
 
30
30
 
31
- ### 該当のソースコード_二重for文を回す
31
+ ### 該当のソースコード BAのコード
32
32
 
33
33
  ```Python3
34
34
  import os
@@ -55,26 +55,21 @@
55
55
  PathName = "C://Users//For Programming//Documents//Python Scripts//test//*.csv"
56
56
  AnalysisObject_files= glob.glob(PathName)
57
57
 
58
+ All_Data = []
59
+ for i in AnalysisObject_files:
60
+ df = identification_filetype(i)
61
+ df1 = Convert_Onedimensional_Array(df)
62
+ All_Data.append(df1)
58
63
 
59
- def SequencePlot(filepath):
60
64
 
61
- fig, axes = plt.subplots(nrows=10, ncols=10)
65
+ fig, axes = plt.subplots(nrows=10, ncols=10)
62
66
 
63
- for i in range(10):
67
+ for data, ax in zip(All_Data, axes.ravel()):
64
- for j in range(10):
65
- ax = axes[i, j]
68
+ ax.hist(data)
66
69
 
67
- for csvpath in filepath:
68
- df = identification_filetype(csvpath)
69
- df1 = Convert_Onedimensional_Array(df)
70
- ax.hist(df1)
71
70
 
72
- plt.tight_layout()
71
+ plt.tight_layout()
73
- plt.show()
72
+ plt.show()
74
-
75
-
76
- SequencePlot(AnalysisObject_files)
77
-
78
73
  ```
79
74
 
80
75
  ### 試したこと

1

再度実装したコードに書き直し

2020/02/19 13:07

投稿

Danrussia
Danrussia

スコア44

title CHANGED
File without changes
body CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
 
30
30
 
31
- ### 該当のソースコード
31
+ ### 該当のソースコード_二重for文を回す
32
32
 
33
33
  ```Python3
34
34
  import os
@@ -36,6 +36,7 @@
36
36
  import numpy as np
37
37
  import pandas as pd
38
38
  import matplotlib.pyplot as plt
39
+ import seaborn as sns
39
40
 
40
41
  def identification_filetype(path):
41
42
  _, ext = os.path.splitext(path)
@@ -57,21 +58,23 @@
57
58
 
58
59
  def SequencePlot(filepath):
59
60
 
60
- for csvpath in filepath:
61
- df = identification_filetype(csvpath)
61
+ fig, axes = plt.subplots(nrows=10, ncols=10)
62
- df1 = Convert_Onedimensional_Array(df)
63
62
 
64
-     #ここから以下のコードをどうやって書けばいいかわからない
65
- for i in range(0,100):
63
+ for i in range(10):
66
- ax = fig.add_subplot(10, 10, i)
64
+ for j in range(10):
67
- ax.hist(df1)
65
+ ax = axes[i, j]
68
66
 
67
+ for csvpath in filepath:
68
+ df = identification_filetype(csvpath)
69
+ df1 = Convert_Onedimensional_Array(df)
70
+ ax.hist(df1)
69
71
 
70
72
  plt.tight_layout()
71
73
  plt.show()
72
74
 
73
-
75
+
74
76
  SequencePlot(AnalysisObject_files)
77
+
75
78
  ```
76
79
 
77
80
  ### 試したこと