python - Best option to store data for printing in certain format -


So I need some CSV data from this data, there are two fields, so I calculate something by using value from close There are two more fields and print those four areas in a certain format.

I was thinking of making designated designs with two fields, and after that, I count it two times to add the values ​​of the other two areas. Will this format be the best option to designate, is it another option better, such as dictus or lists?

If the named package is used correctly, then I could add the data and the two fields that add value, I was able to create named topless, but all using SplitLines () on the data With the field and then the designated toplus was making.

I will use the list of dictionaries "named tube" is a straight Like the class, in this way, you should do that, when you prepare a named token, besides what qualities are there, because the tupale is not static on the name of this special structure Does not make flexible for What are you going to do when you want to add a feature to the nominated tuple?

In my opinion, Tupl like the name is like a tupe with additional merit which makes the code more readable. Therefore, if the Tupal is not the data structure for your work, then the meaning of using the designated Tupal.

  // When you only remove "data" and "off" attributes, then store each line as DC1 = {"DATE": "2011-11- 11 "," Off ": 570.00} d2 = {" DATE ":" 2011-11-12 "," off ": 580.00} .... d = [d1, d2] .... // Whenever you want To add additional attributes in the row, simply modify that row [0] ["Indicator"] = 560.00 d [1] ["signal"] = "sale" ....  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -