Jun-13-2018, 04:42 PM
Hey there! Had a question and not sure how to explain it,
I have a file, In this file there are many different columns and goes as follows
Mean1, Max1, Min1, Mean2, Max2, Min2 Etc...
What I am trying to do Is to create a graph with many lines on it, depending on the number of means I Have in the file
Goals:
1. Have the code find any Columns that contain the word mean in its
header
2. Have the code Assign that Column as an x value based on the number that follows the word "mean" So that y1 would be Mean1 etc.
3. I would then like this to Automatically Plot all y values against x (x,y1)(x,y2) etc.
4. If possible I would then like to somehow tell which line is which Although I have not even a vague idea on how to do this
So overall I have an idea of the function of the code that I want, I am just not familiar enough with python or coding in general to apply these functions. So again I am sorry if I am vague, I am merely unknowledgeable on the subject matter. Any help is appreciated! Thanks!
Database = glob.glob("C:\\Users\\Owner\\Desktop\\Database\\Intensity Data\\*\\*\\*csv")
for file in Database:
Graph = pd.read_csv(file)
Pl = Graph.dropna()
Area = Pl["Area"]
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
plt.title('Intensity/area', fontsize = 10)
ax1.legend(loc=3)
plt.show()
I have a file, In this file there are many different columns and goes as follows
Mean1, Max1, Min1, Mean2, Max2, Min2 Etc...
What I am trying to do Is to create a graph with many lines on it, depending on the number of means I Have in the file
Goals:
1. Have the code find any Columns that contain the word mean in its
header
2. Have the code Assign that Column as an x value based on the number that follows the word "mean" So that y1 would be Mean1 etc.
3. I would then like this to Automatically Plot all y values against x (x,y1)(x,y2) etc.
4. If possible I would then like to somehow tell which line is which Although I have not even a vague idea on how to do this
So overall I have an idea of the function of the code that I want, I am just not familiar enough with python or coding in general to apply these functions. So again I am sorry if I am vague, I am merely unknowledgeable on the subject matter. Any help is appreciated! Thanks!
Database = glob.glob("C:\\Users\\Owner\\Desktop\\Database\\Intensity Data\\*\\*\\*csv")
for file in Database:
Graph = pd.read_csv(file)
Pl = Graph.dropna()
Area = Pl["Area"]
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
plt.title('Intensity/area', fontsize = 10)
ax1.legend(loc=3)
plt.show()