-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afbcff9
commit 1227fac
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#HackCarleton | ||
#13 April, 2019 | ||
# Bat-Orgil Batjargal\ | ||
|
||
|
||
import pandas as pd | ||
df = pd.read_csv("C:/Users/bator/Desktop/HackCarleton/Book.csv") | ||
#print (df) | ||
locations = {} | ||
for row in df.itertuples(): | ||
# print(row[5]) #string | ||
Value = row[5].casefold() | ||
try: | ||
locations[Value] = locations[Value] + 1 | ||
except: | ||
locations[Value]=1 | ||
|
||
print (locations) | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#HackCarleton | ||
#13 April, 2019 | ||
# Bat-Orgil Batjargal | ||
|
||
#x = "3:00PM" #15 | ||
#y = "13:00" #13 | ||
#z = "1:00am" #13 | ||
#n = "9:00" #21 | ||
|
||
def my_function(hourInString): | ||
numberCollecter = "" | ||
letterCollecter = "" | ||
leftNumber = "" | ||
|
||
numbersAndCharacter = [":","0","1","2","3","4","5","6","7","8","9"] | ||
letters = ["a","m","p"] | ||
|
||
for i in hourInString.casefold(): | ||
if i in numbersAndCharacter: | ||
numberCollecter += i | ||
elif i in letters: | ||
letterCollecter += i | ||
|
||
if len(numberCollecter)==4: | ||
numberCollecter ="0" + numberCollecter | ||
|
||
if (letterCollecter == "pm"): | ||
leftNumber = numberCollecter[:2] | ||
updatedNumberCollecter = str(int(leftNumber)+12)+numberCollecter[-3:] | ||
return updatedNumberCollecter | ||
else: | ||
return numberCollecter | ||
|
||
|
||
|
||
#def main (): | ||
# answer = my_function(n) | ||
# print (answer) | ||
#main() |