diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 5e6c02eab574d..b642e3f085c22 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -77,8 +77,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.errors.SpecificationError \ pandas.errors.UndefinedVariableError \ pandas.read_json \ - pandas.io.formats.style.Styler.to_latex \ - pandas.read_parquet \ pandas.DataFrame.to_sql \ RET=$(($RET + $?)) ; echo $MSG "DONE" diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 7bbdfdfc6a2fe..c85c6c3ef0ff7 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -987,11 +987,11 @@ def to_latex( hide the repeated level-0 of the index: >>> (styler.format(subset="Equity", precision=2) - ... .format(subset="Stats", precision=1, thousands=",") - ... .format(subset="Rating", formatter=str.upper) - ... .format_index(escape="latex", axis=1) - ... .format_index(escape="latex", axis=0) - ... .hide(level=0, axis=0)) # doctest: +SKIP + ... .format(subset="Stats", precision=1, thousands=",") + ... .format(subset="Rating", formatter=str.upper) + ... .format_index(escape="latex", axis=1) + ... .format_index(escape="latex", axis=0) + ... .hide(level=0, axis=0)) # doctest: +SKIP Note that one of the string entries of the index and column headers is "H&M". Without applying the `escape="latex"` option to the `format_index` method the @@ -1003,12 +1003,15 @@ def to_latex( recommendation: >>> def rating_color(v): - ... if v == "Buy": color = "#33ff85" - ... elif v == "Sell": color = "#ff5933" - ... else: color = "#ffdd33" + ... if v == "Buy": + ... color = "#33ff85" + ... elif v == "Sell": + ... color = "#ff5933" + ... else: + ... color = "#ffdd33" ... return f"color: {color}; font-weight: bold;" >>> (styler.background_gradient(cmap="inferno", subset="Equity", vmin=0, vmax=1) - ... .map(rating_color, subset="Rating")) # doctest: +SKIP + ... .map(rating_color, subset="Rating")) # doctest: +SKIP All the above styles will work with HTML (see below) and LaTeX upon conversion: diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 9570d6f8b26bd..5d0bc3f2c159b 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -510,6 +510,9 @@ def read_parquet( """ Load a parquet object from the file path, returning a DataFrame. + The function automatically handles reading the data from a parquet file + and creates a DataFrame with the appropriate structure. + Parameters ---------- path : str, path object or file-like object @@ -591,6 +594,7 @@ def read_parquet( Returns ------- DataFrame + DataFrame based on parquet file. See Also -------- @@ -600,7 +604,7 @@ def read_parquet( -------- >>> original_df = pd.DataFrame( ... {{"foo": range(5), "bar": range(5, 10)}} - ... ) + ... ) >>> original_df foo bar 0 0 5