Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Glob and automating help
#1
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()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Is there a python program for automating this invoicing workflow? PG_Archipelago 3 1,031 Feb-02-2023, 11:01 PM
Last Post: Larz60+
  |SOLVED] Glob JPGs, read EXIF, update file timestamp? Winfried 5 2,413 Oct-21-2021, 03:29 AM
Last Post: buran
  [SOLVED] Input parameter: Single file or glob? Winfried 0 1,540 Sep-10-2021, 11:54 AM
Last Post: Winfried
  q re glob.iglob iterator and close jimr 2 2,179 Aug-23-2021, 10:14 PM
Last Post: perfringo
  Help with Creating a Script for Automating Reports SunWers 1 1,883 Dec-29-2020, 10:21 PM
Last Post: jjc385
  Automating to run python script 100 times by changing parameters pmt 1 2,563 Dec-29-2020, 10:31 AM
Last Post: andydoc
  Listing files with glob. MathCommander 9 4,815 Oct-26-2020, 02:04 AM
Last Post: MathCommander
  Automating Windows GUI applications metro17 4 12,176 Feb-10-2020, 09:46 AM
Last Post: metro17
  Version of glob for that Supports Windows Wildcards? Reverend_Jim 5 5,575 Jun-18-2019, 06:31 PM
Last Post: Reverend_Jim
  Automating Excel sheets with Python wendysling 1 2,535 Mar-15-2019, 01:39 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020