Skip to content

Commit

Permalink
🎨 add column width to pandas formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
enryH committed Nov 26, 2024
1 parent 1fa5316 commit dd445bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/dsp_pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
__version__ = metadata.version("dsp_pandas")

from . import format as pd_format
from . import io

# The __all__ variable is a list of variables which are imported
# when a user does "from example import *"
Expand Down
8 changes: 5 additions & 3 deletions src/dsp_pandas/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@


def set_pandas_options(
max_columns: int = 100,
max_row: int = 30,
min_row: int = 20,
max_columns: int = 20,
max_row: int = 60,
min_row: int = 10,
max_colwidth: int = 50,
float_format: str = "{:,.3f}",
) -> None:
"""Update default pandas options for better display."""
pd.options.display.max_columns = max_columns
pd.options.display.max_rows = max_row
pd.options.display.min_rows = min_row
pd.options.display.max_colwidth = max_colwidth
set_pandas_number_formatting(float_format=float_format)


Expand Down

0 comments on commit dd445bc

Please sign in to comment.