Closed Leeeeeee001 closed 5 years ago
@Leeeeeee001 Thanks! I have fixed the readme: you need to read data first to get headers.
Or more precisely - reading has to be started to get headers. E.g.
for row in resource.iter():
resource.headers
row
The result that "print(resource.headers) # ['city', 'location'] ", is not "['city', 'location'] ", but None. code: from datapackage import *
path = r'https://raw.githubusercontent.com/frictionlessdata/datapackage-py/master/data/data.csv' resource = Resource({'path': path}) print(resource.tabular) # true print(resource.headers) # ['city', 'location'] print(resource.read(keyed=True))
result: True None [{'city': 'london', 'location': '51.50,-0.11'},................