Skip to content

Instantly share code, notes, and snippets.

@liliya2022
Created March 12, 2023 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liliya2022/a49b7bc20bdf53354a6fbe28cdc4d2a5 to your computer and use it in GitHub Desktop.
Save liliya2022/a49b7bc20bdf53354a6fbe28cdc4d2a5 to your computer and use it in GitHub Desktop.
import scipy.stats as stats
plt.figure(figsize=(16, 10))
for f, label in ((same_1990s, "Not Remodelled"),
(remodelled_1990s, "Remodelled"),
(built_1990s, "Built after 1990")):
x = np.sort(price[f])
plt.hist(x, density=True, alpha=0.1)
density = stats.gaussian_kde(x)
plt.plot(x, density(x), linewidth=4, label=label)
plt.xlabel("House Prices", fontsize=13)
plt.ylabel("House Count", fontsize=13)
plt.legend()
plt.title("House Prices Comparasion", fontsize=20)
print("Histogram")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment