Home › Forums › Fórum Python para Finanças: Análise de Dados e Machine Learning › base de dados com mais acoes
- This topic has 1 reply, 2 voices, and was last updated 4 years, 8 months ago by Fábio Spak. 
- AuthorPosts
- 4 de fevereiro de 2021 at 16:46 #27600acoes_df = pd.DataFrame() 
 for acao in acoes:
 acoes_df[acao] = data.DataReader(acao, data_source=’yahoo’, start=’2015-01-01′)erro ————————————————————————— ValueError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/pandas/core/frame.py in _ensure_valid_index(self, value) 
 3169 try:
 -> 3170 value = Series(value)
 3171 except (ValueError, NotImplementedError, TypeError) as err:6 frames 
 ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().The above exception was the direct cause of the following exception: ValueError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/pandas/core/frame.py in _ensure_valid_index(self, value) 
 3173 “Cannot set a frame with no defined index ”
 3174 “and a value that cannot be converted to a Series”
 -> 3175 ) from err
 3176
 3177 # GH31368 preserve name of indexValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series 
 22 de fevereiro de 2021 at 21:16 #27751Boa noite Pereira, esta faltando o atributo [‘Close’]. Veja abaixo como deve ficar: acoes_df = pd.DataFrame() for acao in acoes: acoes_df[acao] = data.DataReader(acao, data_source='yahoo', start='2015-01-01')['Close'] Fabio 
- AuthorPosts
- You must be logged in to reply to this topic.