[Tutor] CSV Read

David Rock david at graniteweb.com
Sat Jun 30 21:02:39 EDT 2018


> On Jun 30, 2018, at 02:01, Peter Otten <__peter__ at web.de> wrote:
> 
> 
> Rather than forcing both blocks into the same data structure I would read 
> the header with the "key: value" lines into a separate object.
> 
> If the header and the X,Y pairs are separated by an empty line read until 
> that and then feed the file object to pandas.read_csv() to read those pairs:

Ultimately, everything presented so far is conjecture without getting clarification from the original poster on what they actually need and what the dataset looks like.  Does every file look the same? is it always a header and data separated by empty lines?

Hopefully we will get some feedback.


— 
David Rock
david at graniteweb.com






More information about the Tutor mailing list