format_paper_summary¶
format_paper_summary
¶
format_paper_summary(profile: Series | DataFrame, *, fmt: str = 'markdown', decimals: int = 2) -> str
Render a profile as a publication-ready Markdown or LaTeX table.
Every paper carries a "Table 1: dataset description". Turning the raw output of
system_profile or compare_systems into a clean table (rounded floats,
thousands separators, aligned columns) is a recurring twenty-minute chore. This does
it in one call. It only formats your own profiling output; it computes nothing new.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile
|
Series or DataFrame
|
A profile, e.g. from |
required |
fmt
|
('markdown', 'latex')
|
Output dialect. |
"markdown"
|
decimals
|
int
|
Rounding for floating-point cells (thousands separators are added in Markdown). |
2
|
Returns:
| Type | Description |
|---|---|
str
|
The formatted table, ready to paste into a manuscript. |
See Also
system_profile : The single-system profile to format.
compare_systems : The multi-system table to format.
Examples:
>>> import pandas as pd
>>> prof = pd.Series({"n_stations": 100, "mean_occupancy": 0.4123})
>>> out = format_paper_summary(prof)
>>> "mean_occupancy" in out and "0.41" in out
True
Source code in src/gbfs_toolkit/analytics/distribution.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |