question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

csvstat: Add option to remove thousands separator

See original GitHub issue

csvstat is great for quickly summarizing data! However, its default output format is not machine-readable, in the sense that it includes thousands separators. These (sometimes) cannot be easily considered when further processing the data.

$ csvstat -t logs/encode-x264-16-1080-jobs.log -c JobRuntime --sum 
2,669.973

Would it make sense to make the grouping argument optional here (maybe --no-decimal-grouping/--no-thousands-separator or something to preserve the default)?

https://github.com/wireservice/csvkit/blob/bb34039742b0e91ce9cc26039c4292ec258fcdd1/csvkit/utilities/csvstat.py#L348-L349

Or maybe allow the user to specify via format strings how they want numbers to be printed?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
slhckcommented, Jul 26, 2022

For easier review I created a PR here: https://github.com/wireservice/csvkit/pull/1180

1reaction
slhckcommented, Jul 26, 2022

This is not possible because the format_string method takes a dedicated grouping option. I personally would prefer to have grouping disabled by default, and enabled on request — it would also not be a breaking change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

csvkit - Release 1.0.5
Note: csvkit, by default, sniffs CSV formats (it deduces whether commas, tabs or spaces delimit fields, for example),.
Read more >
Remove 1000's separator from column in CSV? - Stack Overflow
import csv import locale # Set local to someplace that uses a comma for the thousands separator. locale.setlocale(locale.
Read more >
Remove thousands separator for numbers in a CSV exported ...
I'm trying to export a grid to a .csv file. I've followed the documentation and am using the API to trigger an export...
Read more >
Unreal Engine 4.24 Release Notes
Merge geometry together, remove or substitute unnecessary Actors, ... performance and memory improvements when your scene contains many thousands of Actors.
Read more >
From NCBI's Sequence Read Archive (SRA) to Galaxy
Accessing SRA; SRA Run Selector; Back in Galaxy; Download sequencing data with Faster Download and Extract Reads in FASTQ. Now what?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found