Skip to content

Commit e644538

Browse files
committed
update titanic file
1 parent c422105 commit e644538

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.idea/dataSources.local.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pandas/Titanic Data Preprocessing.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
pd.set_option('display.max_columns', None)
66

7+
data = [i*2 for i in range(6)]
8+
print(data)
9+
10+
s = "Hello Abu Bakkar Siddikk"
11+
cons = "".join([c for c in s.lower() if c not in 'aeiou'])
12+
print(cons)
13+
714
training_set = pd.read_csv('train.csv')
815
# print(training_set.head(n=5))
916
# print(training_set.shape)
@@ -31,6 +38,17 @@ def assignDeckValue(CabinCode):
3138
training_set = training_set.assign(Deck=Deck)
3239
# print(training_set.head(5))
3340

41+
#i want to make a function which function return a value male or female given the value hight, weigh, shoe size, body size
42+
43+
def decideMaleOrFemale(height, weight, shoe_size, body_size):
44+
if height > 5.5 and weight > 70 and shoe_size > 9 and body_size > 36:
45+
value = "Male"
46+
else:
47+
value = "Female"
48+
return value
49+
50+
print (decideMaleOrFemale(5.7, 75, 10, 41))
51+
3452
#################################################################################
3553

3654
training_set['FamilySize'] = training_set['SibSp'] + training_set['Parch'] + 1

0 commit comments

Comments
 (0)