用python根据Year列和Journal name列和catogory列进行匹配,写代码
时间: 2024-05-06 19:22:01 浏览: 10
Sure, I can help you with that. Here is some sample code that should do the trick:
```python
import pandas as pd
# read in the data from a csv file
data = pd.read_csv("your_csv_file.csv")
# define the columns to match on
cols_to_match = ["Year", "Journal name", "category"]
# group the data by these columns to find matches
matches = data.groupby(cols_to_match)
# loop through the matches and do something with them
for match, group in matches:
# do something with the matching group of rows, such as print them
print(group)
```
Of course, you'll need to modify this code to fit your specific situation, but this should give you a good starting point. Let me know if you have any questions or if there's anything else I can do to help!