Thanks in advance- the problem is to compare rows of two separate dataframes of csv files; with and without column headings. I want to match rows in second dataframe to rows in dataframe one. I cannot use merge because both don't have common column names to merge with.
1: The first dataframe have headings
2: Second dataframe is without headings.
3: get the position of the match
I have tried this:
df1 = pd.read_csv(data1)
df2 = pd.read_csv(data2)
def test1():
for index, rows in df1.iterrows():
if rows in (df2):
return nrows
Datasets:
first dataset:
Second dataset:

iterrows(),itertuples()is far better. Can you share the actual content of the DataFrames or files? See: minimal reproducible example.