Skip to content

Update pytables.py to include a more thorough description of the min_itemsize variable #62068

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,12 @@ def put(
complevel : int, 0-9, default None
Specifies a compression level for data.
A value of 0 or None disables compression.
min_itemsize : int, dict, or None
Dict of columns that specify minimum str sizes.
min_itemsize : int, dict, or None, default None
Refers to the minimum size for string columns in bytes.
When the format = 'table'.
Since this specifies the byte length after encoding,
multi-byte characters need to be calculated using
their encoded byte length rather than character count.
nan_rep : str
Str to use as str nan representation.
data_columns : list of columns or True, default None
Expand Down Expand Up @@ -1203,6 +1207,9 @@ def put(
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
>>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP
>>> store.put("data", df) # doctest: +SKIP

>>> The word 'hello' = 5 bytes
>>> Japanese character "勉" = 2 bytes
"""
if format is None:
format = get_option("io.hdf.default_format") or "fixed"
Expand Down Expand Up @@ -1330,8 +1337,12 @@ def append(
A value of 0 or None disables compression.
columns : default None
This parameter is currently not accepted, try data_columns.
min_itemsize : int, dict, or None
Dict of columns that specify minimum str sizes.
min_itemsize : int, dict, or None, default None
Refers to the minimum size for string columns in bytes.
When the format = 'table'.
Since this specifies the byte length after encoding,
multi-byte characters need to be calculated using
their encoded byte length rather than character count.
nan_rep : str
Str to use as str nan representation.
chunksize : int or None
Expand Down Expand Up @@ -1377,6 +1388,9 @@ def append(
1 3 4
0 5 6
1 7 8

>>> The word 'hello' = 5 bytes
>>> Japanese character "勉" = 2 bytes
"""
if columns is not None:
raise TypeError(
Expand Down
Loading