cosmograph-org / cosmograph-issues

This is an issue-only repository for the Cosmograph application and library.
0 stars 0 forks source link

Use First Column as ID for Meta files #15

Open miklevin opened 8 months ago

miklevin commented 8 months ago

Me again. The next pain point I have is always having to rename the first column in a meta file from Full URL (or whatever) to id on the export from the product I use it with. Again, the problem is in quite how large the files are.

It's not reasonable to ask people to load and save files this large in Excel or Google Sheets just to rename the column label. Sometimes I use a Python script to do it, and other times I do it into vim. All of these options are to technical and show-stoppers when I try to walk other people though the process.

I imagine that 99 out of 100 times when someone is loading a meta file, the first column contains the id.

So that's the feature request. If no id column is specified, please assume that column 1 is the id column. That at least gives it a default fallback behavior. From my perspective, it is a very big win for a very light touch. Please and thank you!

In other words, I am frequently doing this:

import pandas as pd
df = pd.read_csv("meta.csv")
df.rename(columns={df.columns[0]: 'id'}, inplace=True)
df.to_csv("meta-colored.csv", index=False)
kolmakova commented 8 months ago

Agree, reasonable observation. This should not take a lot of time to add so we'll try to add it soon.