-2
Good afternoon,
I’m trying to extract the largest whole value from every line of my dataframe. I created the following code for this:
for i in df.index:
df["maxx"] = df.loc[i].max()
df["minn"] = df.loc[i].min()
The expected result was to generate two columns in the dataframe (df["maxx"] e df["minn"]
) with the following values:
max line 1 = 23
min line 1 = 3
max line 2 = 78
min line 2 = 2
But the result found is: max line 1 = 78 min line 1 = 2 max line 2 = 78 min line 2 = 2
What should I change in my code to consider max and min per line and not the total dataframe?