Skip to content

Commit bc930cb

Browse files
author
Nico Cernek
committed
replace .from_records with default constructor
1 parent 2137677 commit bc930cb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/reshape/merge/test_merge.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2091,19 +2091,19 @@ def test_right_merge_preserves_row_order():
20912091
("Carl", "Canada", 30),
20922092
]
20932093
columns = ["name", "country", "population"]
2094-
pop = DataFrame.from_records(population, columns=columns)
2094+
pop = DataFrame(population, columns=columns)
20952095

20962096
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
20972097
columns = ["name", "country"]
2098-
ppl = DataFrame.from_records(people, columns=columns)
2098+
ppl = DataFrame(people, columns=columns)
20992099

21002100
expected_data = [
21012101
("Abe", "America", np.nan),
21022102
("Beth", "Bulgaria", 7),
21032103
("Carl", "Canada", 30),
21042104
]
21052105
expected_cols = ["name", "country", "population"]
2106-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2106+
expected = DataFrame(expected_data, columns=expected_cols)
21072107

21082108
result = pop.merge(ppl, on=("name", "country"), how="right")
21092109

@@ -2117,19 +2117,19 @@ def test_left_merge_preserves_row_order():
21172117
("Carl", "Canada", 30),
21182118
]
21192119
columns = ["name", "country", "population"]
2120-
pop = DataFrame.from_records(population, columns=columns)
2120+
pop = DataFrame(population, columns=columns)
21212121

21222122
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
21232123
columns = ["name", "country"]
2124-
ppl = DataFrame.from_records(people, columns=columns)
2124+
ppl = DataFrame(people, columns=columns)
21252125

21262126
expected_data = [
21272127
("Abe", "America", np.nan),
21282128
("Beth", "Bulgaria", 7),
21292129
("Carl", "Canada", 30),
21302130
]
21312131
expected_cols = ["name", "country", "population"]
2132-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2132+
expected = DataFrame(expected_data, columns=expected_cols)
21332133

21342134
result = ppl.merge(pop, on=("name", "country"), how="left")
21352135

0 commit comments

Comments
 (0)