« first day (3891 days earlier)      last day (1032 days later) » 

2:02 AM
Hi guys, I would like some suggestions on how to achieve this loop:
Basically in my dataframe, I want to go through each date and do some processing based on the string value of a certain column of the dataframe...

this is my code.:
       day_type_labels = ['cloudless', 'mostly_cloudless', 'broken_clouds', 'cloudy']

date = df.Date.unique()
ind_date = df.Date == date[0]

for i in range(len(day_type_labels)):

    if df_final[ind_date].Day_type.all() == day_type_labels[i]:
        print('s')
Hi guys, I would like some suggestions on how to achieve this loop:
Basically in my dataframe, I want to go through each date and do some processing based on the string value of a certain column of the dataframe...
day_type_labels = ['cloudless', 'mostly_cloudless', 'broken_clouds', 'cloudy']

date = df.Date.unique()
ind_date = df.Date == date[0]

for i in range(len(day_type_labels)):

    if df_final[ind_date].Day_type.all() == day_type_labels[i]:
        print('s')
 
@cmk101010 Hi open to any suggestion :), I'm Oak!
 
:)
 
 
9 hours later…
11:24 AM
cbg , I am trying to captilaize the latter half of any given string using the function below.However to my suprise the function works only with the string : "geeks for geek" ; the string : "apples" remains unchanged.Can anyone explain why is this happening?
def func(str):
    "Capitalizes the latter half of the string"
    for i in range(len(str)):
        if i == (len(str)//2):
            str2 = (len(s)//2)
            str3 = str[str2:].upper()
            print(str3)
    print(str[:str2]+str3)


s = "geeks for geek"
s2 = "apples"
func(s2)
func(s)
 

« first day (3891 days earlier)      last day (1032 days later) »