79623743

Date: 2025-05-15 15:45:30
Score: 0.5
Natty:
Report link

# Make a copy of the DataFrame
df_copy = df.copy()
import pandas as pd

result = []

for drink in order:
    idx = df_copy[df_copy['Drink'] == drink].index.min()
    if pd.notna(idx):
        result.append(df_copy.loc[idx])
        df_copy = df_copy.drop(index=idx)


ordered_df = pd.DataFrame(result)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: mani