Я создал метод, который предполагает добавление множества фреймов данных (df) в один (base_df) в a для l oop. Это не приносит никаких ошибок, просто base_df остается пустым. У df dataframe есть данные. Пожалуйста помоги. Спасибо.
#concatenate all files into one dataframe.
def concatenate_all_in_one( bucket, prefix):
response = s3_client.list_objects(Bucket=bucket, Prefix=prefix)
content_list = response['Contents']
base_df = pd.DataFrame()
for item in content_list:
try:
df = get_df_by_bucket_and_key(bucket, item['Key']) #this works fine
print("this is df name of the file", item['Key'] )
print("this is df info", df.head())
base_df = base_df.append(df,ignore_index = True )
except Exception as e :
print(e)
print("Did not append", item['Key'])
print("This is base_df info", base_df.info())
return base_df ```