Python Forum
How to sort .csv file test log which item first fail and paint color
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to sort .csv file test log which item first fail and paint color
#2
You are working with a large amount of data, which is creating huge lists (len = 385), much of the data is duplicated, within the lists, which is very confusing.

Also, I'm unsure why you are creating two objects: header and listreport. You could do the exact same thing with one object (the iterator in the for loop), which I've named row.

with open('Log.csv') as log:
   csv_reader = csv.reader(log)
   for row in csv_reader:
      if count<3:
         array.append(row)
      if row[5]=='Failed':
         failed.append(row)
      count+=1
I'm still unclear about your objective, as your English is a little hard for me to follow; I can see that you are doing your best, so the fail here is more on my side than yours.

I'll have a think about this and try to offer better help, but if you can find a way to help me better understand your objective, then please do.

edit to add:

I think that the major issue here is that you're trying to do too much at once: the task needs to be broken down into smaller steps (sub-tasks, if you will), solving one thing at a time, each step moving ever closer to the solution.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
RE: How to sort .csv file test log which item first fail and paint color - by rob101 - Aug-06-2022, 07:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 1,339 Oct-25-2023, 09:09 AM
Last Post: codelab
  Why does [root.destroy, exit()]) fail after pyinstaller? Rpi Edward_ 4 767 Oct-18-2023, 11:09 PM
Last Post: Edward_
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,064 Feb-15-2023, 05:34 PM
Last Post: zsousa
  How to calculated how many fail in each site(s) in csv files SamLiu 4 1,428 Sep-26-2022, 06:28 AM
Last Post: SamLiu
Photo a.sort() == b.sort() all the time 3lnyn0 1 1,439 Apr-19-2022, 06:50 PM
Last Post: Gribouillis
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,733 Mar-11-2022, 01:50 PM
Last Post: snippsat
  Remove an item from a list contained in another item in python CompleteNewb 19 6,220 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  [SOLVED] Why does regex fail cleaning line? Winfried 5 2,649 Aug-22-2021, 06:59 PM
Last Post: Winfried
  scraping video src fail jacklee26 5 3,758 Jul-11-2021, 09:38 AM
Last Post: snippsat
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 3,387 Jul-03-2021, 10:07 AM
Last Post: Anldra12

Forum Jump:

User Panel Messages

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