Thanks a lot for creating this library, i have been using this library for some time now. But suddenly , below function is not working .
investpy.stocks.get_stock_information(stock='DIAL',country='sri lanka', as_json=True)
Upgraded to investpy version 1.0.7 , but no luck
Result
AttributeError Traceback (most recent call last)
in
----> 1 investpy.stocks.get_stock_information(stock='DIAL',country='sri lanka', as_json=True)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\investpy\stocks.py in get_stock_information(stock, country, as_json)
1104 result = pd.DataFrame(columns=['Stock Symbol', 'Prev. Close', 'Todays Range', 'Revenue', 'Open', '52 wk Range',
1105 'EPS', 'Volume', 'Market Cap', 'Dividend (Yield)', 'Average Vol. (3m)', 'P/E Ratio',
-> 1106 'Beta', '1-Year Change', 'Shares Outstanding', 'Next Earnings Date'])
1107 result.at[0, 'Stock Symbol'] = stock
1108
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\frame.py in __init__(self, data, index, columns, dtype, copy)
433 )
434 elif isinstance(data, dict):
--> 435 mgr = init_dict(data, index, columns, dtype=dtype)
436 elif isinstance(data, ma.MaskedArray):
437 import numpy.ma.mrecords as mrecords
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\internals\construction.py in init_dict(data, index, columns, dtype)
237 else:
238 nan_dtype = dtype
--> 239 val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype)
240 arrays.loc[missing] = [val] * missing.sum()
241
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py in construct_1d_arraylike_from_scalar(value, length, dtype)
1438 else:
1439 if not isinstance(dtype, (np.dtype, type(np.dtype))):
-> 1440 dtype = dtype.dtype
1441
1442 if length and is_integer_dtype(dtype) and isna(value):
AttributeError: type object 'object' has no attribute 'dtype'
Dear @alvarobartt ,
Thanks a lot for creating this library, i have been using this library for some time now. But suddenly , below function is not working . investpy.stocks.get_stock_information(stock='DIAL',country='sri lanka', as_json=True)
Result
AttributeError Traceback (most recent call last)