Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a column name for all first columns in zone data and results #325

Open
johpiip opened this issue Jun 8, 2021 · 4 comments
Open

Add a column name for all first columns in zone data and results #325

johpiip opened this issue Jun 8, 2021 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@johpiip
Copy link
Contributor

johpiip commented Jun 8, 2021

None of the input zone data files have a name for the first column. Behaviour is the same for result data. Having a name for the first column would make reading and referencing the data easier in R. What the name really is is insignificant. It can be just "group" or "class", or "x" instead of real names like "zone", "municipality", or "mode".

Examples of current behaviour:

Improved behaviour:

  • 2016.wrk:
    zone	total	sh_serv	sh_shop	sh_logi	sh_indu
    5	7	0.2	0.1	0	0.1
    6	5	0.2	0.2	0.1	0
    ...
    
  • transit_kms.txt:
    mode	dist	time
    metro	14627.57647	20409.43607
    tram	14539.94966	63296.97222
    bus	387704.60918	744000.78360
    ...
    
@zptro
Copy link
Collaborator

zptro commented Jun 9, 2021

The desired behavior seems to be achieved with index_col=0 parameter in pandas.read_csv() and index_label parameter in DataFrame.to_csv(). The format could easily be changed for output files, but we should then always feed a describing name for the index. Input files are a bit trickier, because it seems we will then drop support for the current format.

@zptro
Copy link
Collaborator

zptro commented Feb 22, 2023

@johpiip Should this be considered a Helmet 5 feature? Would it be time to create a development branch?

@johpiip
Copy link
Contributor Author

johpiip commented Feb 22, 2023

@zptro This being Helmet 5 feature sounds like a good idea. Is there a sudden need for this PR or a Helmet 5 dev branch?

@zptro
Copy link
Collaborator

zptro commented Feb 22, 2023

@johpiip I just realized that if the user has for some reason added an index label as column name in an input file, the resulting error can be really frustrating to find, at least if the intended zone numbers are very near the integer series 1, 2, 3...

@zptro zptro added this to the v5.0 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants