{"action":"created","issue":{"url":"https://api.github.com/repos/BurntSushi/xsv/issues/6","labels_url":"https://api.github.com/repos/BurntSushi/xsv/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/BurntSushi/xsv/issues/6/comments","events_url":"https://api.github.com/repos/BurntSushi/xsv/issues/6/events","html_url":"https://github.com/BurntSushi/xsv/issues/6","id":63834106,"number":6,"title":"Do `xsv stats` and `xsv slice` respect the `--no-headers` option?","user":{"login":"ldcasillas-progreso","id":8095446,"avatar_url":"https://avatars.githubusercontent.com/u/8095446?v=3","gravatar_id":"","url":"https://api.github.com/users/ldcasillas-progreso","html_url":"https://github.com/ldcasillas-progreso","followers_url":"https://api.github.com/users/ldcasillas-progreso/followers","following_url":"https://api.github.com/users/ldcasillas-progreso/following{/other_user}","gists_url":"https://api.github.com/users/ldcasillas-progreso/gists{/gist_id}","starred_url":"https://api.github.com/users/ldcasillas-progreso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldcasillas-progreso/subscriptions","organizations_url":"https://api.github.com/users/ldcasillas-progreso/orgs","repos_url":"https://api.github.com/users/ldcasillas-progreso/repos","events_url":"https://api.github.com/users/ldcasillas-progreso/events{/privacy}","received_events_url":"https://api.github.com/users/ldcasillas-progreso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-23T21:14:10Z","updated_at":"2015-03-23T21:35:37Z","closed_at":null,"body":"The help message printed by `xsv stats --help` mentions the `--no-headers` option:\r\n\r\n        -n, --no-headers       When set, the first row will NOT be interpreted\r\n                               as column names. i.e., They will be included\r\n                               in statistics.\r\n\r\nAnd yet I'm seeing the tool use the first column as the header in cases where I specify `--no-headers`:\r\n\r\n    % head -n 1 2015-3-18_CA_5E63F293-8C7A-4737-A6CE-9E53DFB7DAF7.txt\r\n    209,0000000\r\n\r\n    % xsv stats --no-headers 2015-3-18_CA_5E63F293-8C7A-4737-A6CE-9E53DFB7DAF7.txt\r\n    field,type,min,max,min_length,max_length,mean,stddev\r\n    209,Integer,209,951,3,3,650.419291,216.581229\r\n    0000000,Integer,0,9999999,7,7,5714603.611216,2326579.121568\r\n\r\n    % xsv slice --no-headers -i 0 2015-3-18_CA_5E63F293-8C7A-4737-A6CE-9E53DFB7DAF7.txt\r\n    209,0000000\r\n\r\nContrast with `xsv frequency`, which behaves as I expect:\r\n\r\n    % xsv frequency --no-headers 2015-3-18_CA_5E63F293-8C7A-4737-A6CE-9E53DFB7DAF7.txt\r\n    field,value,count\r\n    1,310,1562992\r\n    1,714,1406572\r\n    1,916,1322587\r\n    1,818,1291127\r\n    1,760,1285504\r\n    1,408,1185066\r\n    1,805,1120246\r\n    1,619,1113284\r\n    1,510,1104539\r\n    1,415,1100438\r\n    2,0000000,22\r\n    2,9999999,20\r\n   [...]"},"comment":{"url":"https://api.github.com/repos/BurntSushi/xsv/issues/comments/85207160","html_url":"https://github.com/BurntSushi/xsv/issues/6#issuecomment-85207160","issue_url":"https://api.github.com/repos/BurntSushi/xsv/issues/6","id":85207160,"user":{"login":"ldcasillas-progreso","id":8095446,"avatar_url":"https://avatars.githubusercontent.com/u/8095446?v=3","gravatar_id":"","url":"https://api.github.com/users/ldcasillas-progreso","html_url":"https://github.com/ldcasillas-progreso","followers_url":"https://api.github.com/users/ldcasillas-progreso/followers","following_url":"https://api.github.com/users/ldcasillas-progreso/following{/other_user}","gists_url":"https://api.github.com/users/ldcasillas-progreso/gists{/gist_id}","starred_url":"https://api.github.com/users/ldcasillas-progreso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldcasillas-progreso/subscriptions","organizations_url":"https://api.github.com/users/ldcasillas-progreso/orgs","repos_url":"https://api.github.com/users/ldcasillas-progreso/repos","events_url":"https://api.github.com/users/ldcasillas-progreso/events{/privacy}","received_events_url":"https://api.github.com/users/ldcasillas-progreso/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T21:35:37Z","updated_at":"2015-03-23T21:35:37Z","body":"> Perhaps an argument could be made that the field names should actually be field numbers when `--no-headers` is passed.\r\n\r\nTaking as a given that the semantics is right, I would argue that:\r\n\r\n1. At the very least all the subcommands should behave uniformly.  My examples show that `xsv stats` and `xsv frequency` behave differently.\r\n2. Using the first row's values as column labels is going to confuse people, even if the semantics of the commands are otherwise right.  At the very least, people are going to hesitate whether `--no-headers` is working right.  Worst case scenario, somebody misinterprets a value-used-as-label as actual data.\r\n3. I have three CSV files with the same logical fields and no headers; when I run stats on them I get different column names for the three files, which does not lend itself to, e.g., joining the `xsv stats` results from the three files."}}