Mar-30-2020, 09:42 AM
hi guys,
how can i connect data so it would be all together (there should be 100 rows)
however, when i am trying to run the script it shows 200 rows
ok i think i got it, probably should have created 2 df and then concatenate them
#didnt work out :P
how can i connect data so it would be all together (there should be 100 rows)
however, when i am trying to run the script it shows 200 rows
empty_list = [] excel = pd.read_excel('Excel.xlsx') survey = excel['Survey'] something = excel['Something_header'] for index, value in enumerate(something): while value == '' or (isinstance(value, float) and math.isnan(value)): value = something[index] index = index - 1 dict = {'something': value} empty_list.append(dict) for survey_index, survey_value in enumerate(survey): while survey_value == '' or (isinstance(survey_value, float) and math.isnan(survey_value)): survey_value = survey[survey_index] survey_index = survey_index - 1 dict2 = {'Survey': survey_value} empty_list.append(dict2) df = pd.DataFrame(empty_list, columns=['Survey', 'something']) print(df)#edit
ok i think i got it, probably should have created 2 df and then concatenate them
#didnt work out :P