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

No spaces in column headers #198

Open
anne17 opened this issue Aug 28, 2024 · 0 comments
Open

No spaces in column headers #198

anne17 opened this issue Aug 28, 2024 · 0 comments

Comments

@anne17
Copy link
Member

anne17 commented Aug 28, 2024

CSV exports produced by Sparv should not have spaces in the column headers. (Requested by Markus)

From en e-mail by Faton (KBlabb) on 2022-12-14:

When working with dataframes in Python, R, and Julia, there exist common convenient patterns of indexing and subsetting columns that do not require users to put quotes around the column name. E.g. if there's a column called name in a dataframe df, in Python and Julia, you can retrieve this column by

df.name
and in R:

# Standard base R
df$name

# dplyr in R
df |>
  select(name)

If spaces exist in column names, e.g. if a coulmn is named name 2, then all of the above patterns will produce errors. The users are then limited to a single way of indexing with brackets and quotes around the column name (or renaming the columns). This is the reason why there exists a strong convention in all these languages to not use, and to recommend against using, spaces in column names. Usually underscores _ are used instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant