We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b86dcb6 commit fc473b7Copy full SHA for fc473b7
pandas/tests/tools/test_concat.py
@@ -1825,14 +1825,16 @@ def test_concat_bug_3602(self):
1825
result = concat([df1, df2], axis=1)
1826
assert_frame_equal(result, expected)
1827
1828
- def test_concat_bug_15328(self):
+ def test_concat_inner_join_empty(self):
1829
+ # GH 15328
1830
df_empty = pd.DataFrame()
- df_a = pd.DataFrame({'a': [1, 2]}, index=[0, 1])
1831
+ df_a = pd.DataFrame({'a': [1, 2]}, index=[0, 1], dtype='int64')
1832
result = pd.concat([df_empty, df_a], axis=1, join='inner')
- self.assertTrue(result.empty)
1833
+ expected = pd.DataFrame({'a': []}, index=[], dtype='int64')
1834
+ assert_frame_equal(result, expected)
1835
1836
result = pd.concat([df_a, df_empty], axis=1, join='inner')
1837
1838
1839
def test_concat_series_axis1_same_names_ignore_index(self):
1840
dates = date_range('01-Jan-2013', '01-Jan-2014', freq='MS')[0:-1]
pandas/tests/tools/test_merge.py
@@ -54,11 +54,13 @@ def setUp(self):
54
self.right = DataFrame({'v2': np.random.randn(4)},
55
index=['d', 'b', 'c', 'a'])
56
57
- def test_merge_bug_15328(self):
+ def test_merge_inner_join_empty(self):
58
59
60
61
result = pd.merge(df_empty, df_a, left_index=True, right_index=True)
62
63
64
65
def test_merge_common(self):
66
joined = merge(self.df, self.df2)
0 commit comments