Preciso fazer a seguinte condição caso o nome do arquivo, que é um .json, tenha os caracteres VG, AP ou GM em pandas:
if name_arquivo.str.contains('_VG_') or name_arquivo.str.contains('_AP_') or name_arquivo.str.contains('_GM_'):
df_s3['PremioTotal'] = df_s3.apply(
lambda x: [coberturas['PremioTotal'] for coberturas in x.Coberturas],
axis=1,
result_type='expand')
Porém estou obtendo o seguinte erro:
AttributeError: 'str' object has no attribute 'str'
Alguém pode me ajudar, por favor?
name_arquivo
deve ser do tipo string. Sendo assim oif
deveria serif "_VG_" in name_arquivo or "_AP_" in name_arquivo or "_GM_" in name_arquivo: