N
N
nurs9482020-12-03 20:55:06
Python
nurs948, 2020-12-03 20:55:06

How to match data from according to values ​​from another array?

How to match data by value from another dataframe?

for example, there is df1
id name cost
1 gift1 1250
2 gift2 2750
3 gift3 7850

and there is also df2:
id cost_range price
1 0-1999 low
2 2000-4999 medium
3 5000-9999 high

the desired result should be such that the program compares according to the price from the second dataframe

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dugin, 2020-12-03
@adugin

pandas.DataFrame.merge

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question