Skip to content

Commit f1bf6d5

Browse files
author
Nico Cernek
committed
replace .from_records with default constructor
1 parent 9a23eb1 commit f1bf6d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/reshape/merge/test_merge.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,19 +2103,19 @@ def test_right_merge_preserves_row_order():
21032103
("Carl", "Canada", 30),
21042104
]
21052105
columns = ["name", "country", "population"]
2106-
pop = DataFrame.from_records(population, columns=columns)
2106+
pop = DataFrame(population, columns=columns)
21072107

21082108
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
21092109
columns = ["name", "country"]
2110-
ppl = DataFrame.from_records(people, columns=columns)
2110+
ppl = DataFrame(people, columns=columns)
21112111

21122112
expected_data = [
21132113
("Abe", "America", np.nan),
21142114
("Beth", "Bulgaria", 7),
21152115
("Carl", "Canada", 30),
21162116
]
21172117
expected_cols = ["name", "country", "population"]
2118-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2118+
expected = DataFrame(expected_data, columns=expected_cols)
21192119

21202120
result = pop.merge(ppl, on=("name", "country"), how="right")
21212121

@@ -2129,19 +2129,19 @@ def test_left_merge_preserves_row_order():
21292129
("Carl", "Canada", 30),
21302130
]
21312131
columns = ["name", "country", "population"]
2132-
pop = DataFrame.from_records(population, columns=columns)
2132+
pop = DataFrame(population, columns=columns)
21332133

21342134
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
21352135
columns = ["name", "country"]
2136-
ppl = DataFrame.from_records(people, columns=columns)
2136+
ppl = DataFrame(people, columns=columns)
21372137

21382138
expected_data = [
21392139
("Abe", "America", np.nan),
21402140
("Beth", "Bulgaria", 7),
21412141
("Carl", "Canada", 30),
21422142
]
21432143
expected_cols = ["name", "country", "population"]
2144-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2144+
expected = DataFrame(expected_data, columns=expected_cols)
21452145

21462146
result = ppl.merge(pop, on=("name", "country"), how="left")
21472147

0 commit comments

Comments
 (0)