Skip to content

Commit 90984e4

Browse files
author
Nico Cernek
committed
replace .from_records with default constructor
1 parent 7ccebb2 commit 90984e4

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
@@ -2162,19 +2162,19 @@ def test_right_merge_preserves_row_order():
21622162
("Carl", "Canada", 30),
21632163
]
21642164
columns = ["name", "country", "population"]
2165-
pop = DataFrame.from_records(population, columns=columns)
2165+
pop = DataFrame(population, columns=columns)
21662166

21672167
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
21682168
columns = ["name", "country"]
2169-
ppl = DataFrame.from_records(people, columns=columns)
2169+
ppl = DataFrame(people, columns=columns)
21702170

21712171
expected_data = [
21722172
("Abe", "America", np.nan),
21732173
("Beth", "Bulgaria", 7),
21742174
("Carl", "Canada", 30),
21752175
]
21762176
expected_cols = ["name", "country", "population"]
2177-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2177+
expected = DataFrame(expected_data, columns=expected_cols)
21782178

21792179
result = pop.merge(ppl, on=("name", "country"), how="right")
21802180

@@ -2188,19 +2188,19 @@ def test_left_merge_preserves_row_order():
21882188
("Carl", "Canada", 30),
21892189
]
21902190
columns = ["name", "country", "population"]
2191-
pop = DataFrame.from_records(population, columns=columns)
2191+
pop = DataFrame(population, columns=columns)
21922192

21932193
people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
21942194
columns = ["name", "country"]
2195-
ppl = DataFrame.from_records(people, columns=columns)
2195+
ppl = DataFrame(people, columns=columns)
21962196

21972197
expected_data = [
21982198
("Abe", "America", np.nan),
21992199
("Beth", "Bulgaria", 7),
22002200
("Carl", "Canada", 30),
22012201
]
22022202
expected_cols = ["name", "country", "population"]
2203-
expected = DataFrame.from_records(expected_data, columns=expected_cols)
2203+
expected = DataFrame(expected_data, columns=expected_cols)
22042204

22052205
result = ppl.merge(pop, on=("name", "country"), how="left")
22062206

0 commit comments

Comments
 (0)