Skip to content

Commit

Permalink
Updating
Browse files Browse the repository at this point in the history
Uploading files .py and .csv
  • Loading branch information
BrunoGianetti authored Dec 31, 2022
1 parent be83625 commit de39e22
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
43 changes: 43 additions & 0 deletions PresidentHeights/AlturaPresidente.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
order,name,height(cm)
1,George Washington,189
2,John Adams,170
3,Thomas Jefferson,189
4,James Madison,163
5,James Monroe,183
6,John Quincy Adams,171
7,Andrew Jackson,185
8,Martin Van Buren,168
9,William Henry Harrison,173
10,John Tyler,183
11,James K. Polk,173
12,Zachary Taylor,173
13,Millard Fillmore,175
14,Franklin Pierce,178
15,James Buchanan,183
16,Abraham Lincoln,193
17,Andrew Johnson,178
18,Ulysses S. Grant,173
19,Rutherford B. Hayes,174
20,James A. Garfield,183
21,Chester A. Arthur,183
23,Benjamin Harrison,168
25,William McKinley,170
26,Theodore Roosevelt,178
27,William Howard Taft,182
28,Woodrow Wilson,180
29,Warren G. Harding,183
30,Calvin Coolidge,178
31,Herbert Hoover,182
32,Franklin D. Roosevelt,188
33,Harry S. Truman,175
34,Dwight D. Eisenhower,179
35,John F. Kennedy,183
36,Lyndon B. Johnson,193
37,Richard Nixon,182
38,Gerald Ford,183
39,Jimmy Carter,177
40,Ronald Reagan,185
41,George H. W. Bush,188
42,Bill Clinton,188
43,George W. Bush,182
44,Barack Obama,185
42 changes: 42 additions & 0 deletions PresidentHeights/PresidentHeight.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

data = pd.read_csv("AlturaPresidente.csv")
print(data.head())

print(" " * 80)
print("X" * 80)
print(" " * 80)

height = np.array(data["height(cm)"])
print(height)

print(" " * 80)
print("X" * 80)
print(" " * 80)

print("Mean of heights =", height.mean())
print("Standard Deviation of height =", height.std())
print("Minimum height =", height.min())
print("Maximum height =", height.max())

print(" " * 80)
print("X" * 80)
print(" " * 80)

print("25th percentile =", np.percentile(height, 25))
print("Median =", np.median(height))
print("75th percentile =", np.percentile(height, 75))

print(" " * 80)
print("X" * 80)
print(" " * 80)

sns.set()
plt.hist(height)
plt.title("Height Distribution of Presidents of USA")
plt.xlabel("height(cm)")
plt.ylabel("Number")
plt.show()

0 comments on commit de39e22

Please sign in to comment.