8000 BUG/TST: added TypeError if object dtypes are detected in dataframe by sharkipelago · Pull Request #61682 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG/TST: added TypeError if object dtypes are detected in dataframe #61682

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 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
updated copy_view test to reflect that round should only be used on n…
…umeric dfs
  • Loading branch information
sharkipelago committed Jun 22, 2025
commit 1244bde2c534e8ad56c00729a6d57970f6b58481
8 changes: 4 additions & 4 deletions pandas/tests/copy_view/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,20 +911,20 @@ def test_sort_values_inplace(obj, kwargs):

@pytest.mark.parametrize("decimals", [-1, 0, 1])
def test_round(decimals):
df = DataFrame({"a": [1, 2], "b": "c"})
df = DataFrame({"a": [1, 2], "b": [3.3, 4.4]})
df_orig = df.copy()
df2 = df.round(decimals=decimals)

assert tm.shares_memory(get_array(df2, "b"), get_array(df, "b"))
assert not tm.shares_memory(get_array(df2, "b"), get_array(df, "b"))
# TODO: Make inplace by using out parameter of ndarray.round?
if decimals >= 0:
# Ensure lazy copy if no-op
assert np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
else:
assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a"))

df2.iloc[0, 1] = "d"
df2.iloc[0, 0] = 4
df2.iloc[0, 1] = 6.6
df2.iloc[0, 0] = 5
assert not np.shares_memory(get_array(df2, "b"), get_array(df, "b"))
assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a"))
tm.assert_frame_equal(df, df_orig)
Expand Down
Loading
0