You were almost there – the problem is that `plt.hist` will only make meaningful-looking bars if you give it numeric year values and the same bins for both series. In your plot it likely treated the years as strings or had very coarse default bins, so you ended up with only a couple of bars. Convert the year column to numeric, drop NaNs, pick a sensible set of bins (one per year, per decade, or whatever resolution you want), then call `plt.hist` with both arrays and the same `bins`. Use `alpha` and a legend to distinguish the sexes. Example: ```python import numpy as np import matplotlib.pyplot as plt import pandas as pd # Assume df is your full dataframe and 'sex' contains 'male'/'female' # and 'Year' contains the discovery year (may be strings) # 1) Make sure years are numeric df['Year'] = pd.to_numeric(df['Year'], errors='coerce') # 2) Split and drop missing years men_years = df.loc[df['sex'] == 'male', 'Year'].dropna().astype(int) women_years = df.loc[df['sex'] == 'female', 'Year'].dropna().astype(int) # 3) Choose bins (e.g. one per year, or per 5/10 years). Here I choose 10-year bins: min_year = min(df['Year'].min(), 0) max_year = df['Year'].max() bins = np.arange(min_year, max_year + 10, 10) # decade bins # 4) Plot both on the same histogram plt.figure(figsize=(10, 5)) plt.hist([men_years, women_years], bins=bins, color=['#1f77b4', '#ff7f0e'], alpha=0.6, label=['Men', 'Women']) plt.xlabel('Year of Discovery') plt.ylabel('Number of Objects Discovered') plt.title('Discoveries by Year and Sex') plt.legend() plt.grid(axis='y', alpha=0.3) plt.show() ``` Alternatively, with seaborn you can do: ```python import seaborn as sns sns.histplot(data=df.dropna(subset=['Year']), x='Year', hue='sex', bins=50, multiple='layer', alpha=0.6) plt.show() ``` This will give you a proper overlaid histogram across the full year range instead of just two bars.
| Proizvođač | Lorus |
| Kolekcija | Sports |
| Šifra | RH921SX-9 |
| Vrijeme dostave | 1-2 dana |
| Garancija | 12 mjeseci |
| Za spol | Muški |
| Promjer | 40 mm |
| Vodootpornost | 10 ATM |
| Krunica | Obična |
| Materijal narukvice | Stainless-steel |
| Materijal kućišta | Stainless-steel |
| Mehanizam | Quartz |
| Staklo | Mineralno |
| Funkcije | Datum |
Lorus satovi spajaju moderan dizajn pouzdanost i kvalitetu, stvarajući modele prikladne za svakodnevno nošenje i posebne prilike. Brend nudi kvarcne mehanizme i robusna kućišta, kombinujući izdržljivost s privlačnim stilom. Lorus je dio iste grupacije kao Seiko, što dodatno potvrđuje njegovu pouzdanost i visok standard izrade. Ovi satovi predstavljaju praktičan i elegantan izbor za sve koji traže kvalitetan sat koji prati aktivan način života i istovremeno naglašava osobnost nositelja.