Mercurial Hosting > traffic-intelligence
comparison python/utils.py @ 742:fe71639f1ee7 dev
merge and added function to up-/lower-case strings
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 28 Aug 2015 10:39:15 -0400 |
parents | 5b91b8d97cf3 |
children | 10dbab1e871d |
comparison
equal
deleted
inserted
replaced
741:5b91b8d97cf3 | 742:fe71639f1ee7 |
---|---|
9 from scipy.spatial import distance | 9 from scipy.spatial import distance |
10 from numpy import zeros, array, exp, sum as npsum, int as npint, arange, cumsum, median, isnan, ones, convolve, dtype, isnan, NaN, mean, ma, isinf | 10 from numpy import zeros, array, exp, sum as npsum, int as npint, arange, cumsum, median, isnan, ones, convolve, dtype, isnan, NaN, mean, ma, isinf |
11 | 11 |
12 | 12 |
13 datetimeFormat = "%Y-%m-%d %H:%M:%S" | 13 datetimeFormat = "%Y-%m-%d %H:%M:%S" |
14 | |
15 ######################### | |
16 # Strings | |
17 ######################### | |
18 | |
19 def upperCaseFirstLetter(s): | |
20 words = s.split(' ') | |
21 lowerWords = [w[0].upper()+w[1:].lower() for w in words] | |
22 return ' '.join(lowerWords) | |
14 | 23 |
15 ######################### | 24 ######################### |
16 # Enumerations | 25 # Enumerations |
17 ######################### | 26 ######################### |
18 | 27 |