Skip to content

Instantly share code, notes, and snippets.

@siroken3
Created June 25, 2015 02:46
Show Gist options
  • Save siroken3/86f94394ab2b72669ac4 to your computer and use it in GitHub Desktop.
Save siroken3/86f94394ab2b72669ac4 to your computer and use it in GitHub Desktop.
tsvにschemaを付与するテスト
>>> org = '11:00:00 512 256'
>>> dict(zip([sce["name"] for sce in sc], org.split()))
{'time': '11:00:00', 'hoge': '512'}
>>> sc = [{"name":"time", "type":"INTEGER"},{"name":"hoge", "type":"INTEGER"},{"name":"fuga", "type":"STRING"}]
>>> dict(zip([sce["name"] for sce in sc], org.split()))
{'time': '11:00:00', 'fuga': '256', 'hoge': '512'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment