Python Forum
How to change from printFacts ( ) to return a list & Loop over list when writing CSV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change from printFacts ( ) to return a list & Loop over list when writing CSV
#10
(Aug-29-2017, 08:55 PM)Ivan1 Wrote: This is the feedback that I received from Altova's support team:

"The instance may contain multiple values for a fact, the printFacts function returns the last one in such a case. If you want to write all values into one CSV field or a line per value into CSV you may modify printFacts or copy it to another function that returns all values and use that"

I dont have this module as well....so take what i say with a grain of salt as i am rushing typing this as i head out the door.....
factfinder() returns a list and sends it to printFacts() as "facts". Then this functions loops through them under conditions to get "factValue"
Quote:factValue = fact.effective_numeric_value
...
factValue = fact.normalized_value
So based on this i would assume if you make a list and append fact.effective_numeric_value or fact.normalized_value (based on whatever you want) then you would get all the values instead of the last one. Then return the list instead of factValue. But most likely that is going ot break the code as i would assume somewhere it expects that to be an int, but will now get a list.
Recommended Tutorials:
Reply


Messages In This Thread
RE: How to change from printFacts ( ) to return a list & Loop over list when writing CSV - by metulburr - Aug-29-2017, 09:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 308 Apr-18-2024, 09:55 PM
Last Post: deanhystad
  How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 Pleiades 8 15,723 Jan-05-2024, 08:30 PM
Last Post: sgrey
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,188 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Change font in a list or tuple apffal 4 2,703 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  Delete strings from a list to create a new only number list Dvdscot 8 1,558 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 930 Feb-23-2023, 02:21 PM
Last Post: sparkt
  Сheck if an element from a list is in another list that contains a namedtuple elnk 8 1,861 Oct-26-2022, 04:03 PM
Last Post: deanhystad
  convert this List Comprehensions to loop jacklee26 8 1,535 Oct-21-2022, 04:25 PM
Last Post: deanhystad
  How to change the datatype of list elements? mHosseinDS86 9 2,013 Aug-24-2022, 05:26 PM
Last Post: deanhystad
Question Keyword to build list from list of objects? pfdjhfuys 3 1,580 Aug-06-2022, 11:39 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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