Advertisement
gandalfbialy

Untitled

May 10th, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. # Lista cech
  2. features = [
  3. "petal length (cm)",
  4. "petal width (cm)"
  5. ]
  6.  
  7. # Gatunki
  8. species = iris.target_names
  9.  
  10. # Tworzenie tabeli wyników
  11. results = []
  12. for feature in features:
  13. for specie in species:
  14. data = df_test[df_test['species'] == specie][feature]
  15. results.append({
  16. "Feature": feature,
  17. "Species": specie,
  18. "Minimum": 0.8 * data.min(),
  19. "Maximum": 1.2 * data.max(),
  20. "Mean": data.mean()
  21. })
  22.  
  23. # DataFrame z wynikami
  24. summary_df = pd.DataFrame(results)
  25.  
  26. # Wyświetlenie tabeli
  27. print(summary_df)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement