[Tutor] Newbie to Python: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-25 Thread Saran Ahluwalia
My question can be found here: http://stackoverflow.com/questions/31058100/enumerate-column-headers-in-csv-that-belong-to-the-same-tag-key-in-python Here is an additional sample sample of the XML that I am working with: 0 0 0 0

[Tutor] Attacking this problem (2 parts):JSON object to CSV file

2015-06-19 Thread Saran Ahluwalia
Good Evening, I have a conundrum regarding JSON objects and converting them to CSV: *Context* - I am converting XML files to a JSON object (please see snippet below) and then finally producing a CSV file. Here is a an example JSON object: "PAC": { "Account": [{ "PC": "0", "CMC": "0", "W

Re: [Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Saran Ahluwalia
M, Danny Yoo wrote: > > On Apr 2, 2015 9:45 AM, "Saran Ahluwalia" > wrote: > > > > Good Morning: > > > > I understand this error message when I run this code. However, I am > curious > > to know what the most pythonic way is to convert the list to

[Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Saran Ahluwalia
Good Morning: I understand this error message when I run this code. However, I am curious to know what the most pythonic way is to convert the list to a string? I use Python 2.7. "Traceback (most recent call last): before = dict([(f, None) for f in os.listdir(dirlist)]) TypeError: coercing to Un

[Tutor] Question for Strategy for Directory Monitor

2015-04-02 Thread Saran Ahluwalia
Good Evening : Here is what I want me program to do: • *Monitor* a folder for files that are dropped throughout the day • When a file is dropped in the folder the program should scan the file o IF all the contents in the file have the same length (let's assume line length) o THEN the file shou

Re: [Tutor] Feedback on Script for Pandas DataFrame Written into XML

2015-03-30 Thread Saran Ahluwalia
Good Morning Martin: Thank you for your feedback. I have attached a .html file (I would recommend downloading this first and then opening the file), and my .py script. Here is the data . My function (included in the prior

[Tutor] Feedback on Script for Pandas DataFrame Written into XML

2015-03-29 Thread Saran Ahluwalia
Hello: I would appreciate your feedback on whether I correctly wrote my XML. I am exporting a DataFrame and writing into a XML file. I used the ElementTree library. The DataFrame has 11 rows and 8 columns (excluding the index column). #My schema assumption: # #[ #Some number row #Sample text #]

[Tutor] Advice on Strategy for Attacking IO Program

2015-03-29 Thread Saran Ahluwalia
Hello: Here is what I am trying have my program do: • Monitor a folder for files that are dropped throughout the day • When a file is dropped in the folder the program should scan the file o IF all the contents in the file have the same length o THEN the file should be moved to a "success" fo