Once this generator works, it will be very easy to write the csv file.Here is another (far more simple) attempt that addresses your suggestion:I am wondering if there is a more efficient way to do this that is also scalable? My editor is Sublime 2.The value, "Fee" associated with the key, "CF" does should not be included as a column header.The CSV file, when opened with an application such as MS Excel, should be as follows (for exanmple):However at line 24 ("for j in i.keys()): AttributeError: 'str' object has no attribute 'keys'.ANy advice for addressing this. We're a friendly, industry-focused community of ttributeError: 'str' object has no attribute 'decode' Teams. I've this dataset in a CSV file:But when I execute the code I'm getting the following error:read_csv() is not available on DataFrame. ANy advice for addressing this. site design / logo © 2020 Stack Exchange Inc; user contributions licensed under

You need to open it in bytes mode, because unicodecsv reads and writes bytes from files, not text.If you prefer to not open a file in bytes mode, you might check out Successfully merging a pull request may close this issue. Discuss the workings and policies of this site Simply drop the .decode('utf-8') part: From: header_data = name.decode('utf-8') To. However at line 24 ("for j in i.keys()): AttributeError: 'str' object has no attribute 'keys'. I added a subobject foo inside Fee in your json file.So there is a flow of parsing events generated by the Of course you must do a bit of parsing, for example here is how to generate the pairs in the above example (the code must be modified if the json file contains lists)Ahhhh, I see!!! to read csvs using pandas -if you check type(data), it will be pandas DataFrame.For reading data from csv you can use pd.read_csv or pd.read_table. python - AttributeError: 'str' object has no attribute ...AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/connect/images/anonymous.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174629Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174637Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/connect/images/anonymous.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174651Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174653Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/connect/images/anonymous.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174654Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174656Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174658Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/avatars/4/member1095763.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174662Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174701Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/connect/images/anonymous.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174766Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174771Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/avatars/4/member1095763.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174781Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/new-avatars/1/member377908.jpghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174820Re: AttributeError: 'str' object has no attribute 'keys'https://static.daniweb.com/connect/images/anonymous.pnghttps://www.daniweb.com/programming/software-development/threads/497014/attributeerror-str-object-has-no-attribute-keys#post2174903

You have a str, there is no need to decode from UTF-8 anymore. The values that associated should be the tuples in the hypothetical CSV structure. Thank you in advance. Start here for a quick overview of the site Simply drop the .decode('utf-8') part: From: header_data = name.decode('utf-8') To. I am also open to other strategies.I think you should definitely separate read and write. 5,3' replace celery[redis] with only celery, by adding celery in apache-airflow built-in module i. Reach out to all the awesome people in our software development community by starting your own topic.