Skip to content

Commit

Permalink
replace .from_records with default constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Cernek committed Aug 12, 2019
1 parent 2137677 commit bc930cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pandas/tests/reshape/merge/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2091,19 +2091,19 @@ def test_right_merge_preserves_row_order():
("Carl", "Canada", 30),
]
columns = ["name", "country", "population"]
pop = DataFrame.from_records(population, columns=columns)
pop = DataFrame(population, columns=columns)

people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
columns = ["name", "country"]
ppl = DataFrame.from_records(people, columns=columns)
ppl = DataFrame(people, columns=columns)

expected_data = [
("Abe", "America", np.nan),
("Beth", "Bulgaria", 7),
("Carl", "Canada", 30),
]
expected_cols = ["name", "country", "population"]
expected = DataFrame.from_records(expected_data, columns=expected_cols)
expected = DataFrame(expected_data, columns=expected_cols)

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

Expand All @@ -2117,19 +2117,19 @@ def test_left_merge_preserves_row_order():
("Carl", "Canada", 30),
]
columns = ["name", "country", "population"]
pop = DataFrame.from_records(population, columns=columns)
pop = DataFrame(population, columns=columns)

people = [("Abe", "America"), ("Beth", "Bulgaria"), ("Carl", "Canada")]
columns = ["name", "country"]
ppl = DataFrame.from_records(people, columns=columns)
ppl = DataFrame(people, columns=columns)

expected_data = [
("Abe", "America", np.nan),
("Beth", "Bulgaria", 7),
("Carl", "Canada", 30),
]
expected_cols = ["name", "country", "population"]
expected = DataFrame.from_records(expected_data, columns=expected_cols)
expected = DataFrame(expected_data, columns=expected_cols)

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

Expand Down

0 comments on commit bc930cb

Please sign in to comment.