Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
58519d0
TST: Fix doctests for pandas.io.formats.style
Leonardofreua Jul 28, 2021
bb7c3b2
TST: Add link to redirect to Table Visualization user guide
Leonardofreua Jul 28, 2021
fa5a615
TST: Add image to pipe function result
Leonardofreua Jul 28, 2021
378c1f7
TST: Remove unnecessary outputs
Leonardofreua Jul 30, 2021
9dc52e4
TST: Add the output to the Styler.format doctest in to_latex()
Leonardofreua Jul 30, 2021
63535ce
REG: DataFrame.agg where func returns lists and axis=1 (#42762)
rhshadrach Jul 28, 2021
9d72fe0
Fix typing issues for CI (#42770)
Dr-Irv Jul 28, 2021
5ba05f5
BUG: groupby.shift returns different columns when fill_value is speci…
smithto1 Jul 28, 2021
994ff25
PERF: extract_array earlier in DataFrame construction (#42774)
jbrockmendel Jul 28, 2021
6a70067
ENH: `sparse_columns` and `sparse_index` added to `Styler.to_html` (…
attack68 Jul 28, 2021
26e2cd9
TYP: Fix typing for searchsorted (#42788)
rhshadrach Jul 29, 2021
05e0c24
DOC GH42756 Update documentation for pandas.DataFrame.drop to clarify…
Jul 29, 2021
a5d951e
CI: Fix doctests (#42790)
rhshadrach Jul 29, 2021
ebaa9c1
REGR: nanosecond timestamp comparisons to OOB datetimes (#42796)
mzeitlin11 Jul 29, 2021
84f3302
COMPAT: MPL 3.4.0 (#42803)
lithomas1 Jul 29, 2021
76162a4
Delete duplicates and unused code from reshape tests (#42802)
phofl Jul 30, 2021
2c21525
REGR: ValueError raised when both prefix and names are set to None (#…
lithomas1 Jul 30, 2021
13100d8
TST: Add style.py to the doctest check
Leonardofreua Jul 30, 2021
adc540f
TST: fixed eng_formatter doctest for #42671 (#42705)
KrishnaSai2020 Jul 30, 2021
9a35c94
Merge branch 'master' into fix-style-doctests
Leonardofreua Jul 30, 2021
4654dfc
TST: Revert x and y position in some doctests
Leonardofreua Jul 30, 2021
4fe1bea
Merge branch 'fix-style-doctests' of https://github.com/Leonardofreua…
Leonardofreua Jul 30, 2021
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
Next Next commit
Delete duplicates and unused code from reshape tests (#42802)
  • Loading branch information
phofl authored and Leonardofreua committed Jul 30, 2021
commit 76162a483cb7742f5100f34e5575f8ce43a9c893
1 change: 0 additions & 1 deletion pandas/tests/reshape/concat/test_append.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import datetime as dt
from datetime import datetime
from itertools import combinations

import dateutil
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/reshape/concat/test_append_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def test_concatlike_datetimetz_to_object(self, tz_aware_fixture):
)

res = dti1.append(dti3)
# tm.assert_index_equal(res, exp)
tm.assert_index_equal(res, exp)

dts1 = Series(dti1)
dts3 = Series(dti3)
Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/reshape/concat/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def test_concat_copy(self):
assert b.values.base is not None

def test_concat_with_group_keys(self):
df = DataFrame(np.random.randn(4, 3))
df2 = DataFrame(np.random.randn(4, 4))

# axis=0
df = DataFrame(np.random.randn(3, 4))
df2 = DataFrame(np.random.randn(4, 4))
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/reshape/concat/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class TestDataFrameConcat:
def test_concat_multiple_frames_dtypes(self):

# GH#2759
A = DataFrame(data=np.ones((10, 2)), columns=["foo", "bar"], dtype=np.float64)
B = DataFrame(data=np.ones((10, 2)), dtype=np.float32)
results = concat((A, B), axis=1).dtypes
df1 = DataFrame(data=np.ones((10, 2)), columns=["foo", "bar"], dtype=np.float64)
df2 = DataFrame(data=np.ones((10, 2)), dtype=np.float32)
results = concat((df1, df2), axis=1).dtypes
expected = Series(
[np.dtype("float64")] * 2 + [np.dtype("float32")] * 2,
index=["foo", "bar", 0, 1],
Expand Down
22 changes: 11 additions & 11 deletions pandas/tests/reshape/concat/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ def test_concat_rename_index(self):
tm.assert_frame_equal(result, exp)
assert result.index.names == exp.index.names

@pytest.mark.parametrize("test_series", [True, False])
def test_concat_copy_index(self, test_series, axis):
def test_concat_copy_index_series(self, axis):
# GH 29879
if test_series:
ser = Series([1, 2])
comb = concat([ser, ser], axis=axis, copy=True)
assert comb.index is not ser.index
else:
df = DataFrame([[1, 2], [3, 4]], columns=["a", "b"])
comb = concat([df, df], axis=axis, copy=True)
assert comb.index is not df.index
assert comb.columns is not df.columns
ser = Series([1, 2])
comb = concat([ser, ser], axis=axis, copy=True)
assert comb.index is not ser.index

def test_concat_copy_index_frame(self, axis):
# GH 29879
df = DataFrame([[1, 2], [3, 4]], columns=["a", "b"])
comb = concat([df, df], axis=axis, copy=True)
assert comb.index is not df.index
assert comb.columns is not df.columns

def test_default_index(self):
# is_series and ignore_index
Expand Down
17 changes: 3 additions & 14 deletions pandas/tests/reshape/test_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def test_simple():
tm.assert_numpy_array_equal(result, expected, check_dtype=False)


def test_bins():
data = np.array([0.2, 1.4, 2.5, 6.2, 9.7, 2.1])
@pytest.mark.parametrize("func", [list, np.array])
def test_bins(func):
data = func([0.2, 1.4, 2.5, 6.2, 9.7, 2.1])
result, bins = cut(data, 3, retbins=True)

intervals = IntervalIndex.from_breaks(bins.round(3))
Expand Down Expand Up @@ -68,18 +69,6 @@ def test_no_right():
tm.assert_almost_equal(bins, np.array([0.2, 2.575, 4.95, 7.325, 9.7095]))


def test_array_like():
data = [0.2, 1.4, 2.5, 6.2, 9.7, 2.1]
result, bins = cut(data, 3, retbins=True)

intervals = IntervalIndex.from_breaks(bins.round(3))
intervals = intervals.take([0, 0, 0, 1, 2, 0])
expected = Categorical(intervals, ordered=True)

tm.assert_categorical_equal(result, expected)
tm.assert_almost_equal(bins, np.array([0.1905, 3.36666667, 6.53333333, 9.7]))


def test_bins_from_interval_index():
c = cut(range(5), 3)
expected = c
Expand Down