Giter Club home page Giter Club logo

vnquant's People

Contributors

khanhphamdinh-neurd avatar phamdinhkhanh avatar quangbinh1103 avatar quangbinh113 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vnquant's Issues

ModuleNotFoundError: No module named 'src'

First of all, thank you for the package.

I tried with your example code

import vnquant.DataLoader as web
loader = web.DataLoader('VND', '2018-02-02','2018-04-02')
data = loader.download()
data.head()

and get this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-a817844cd804> in <module>()
----> 1 import vnquant.DataLoader as web
      2 loader = web.DataLoader('VND', '2018-02-02','2018-04-02')
      3 data = loader.download()
      4 data.head()

~/Code/python/vnquant/vnquant/DataLoader.py in <module>()
      1 from bs4 import BeautifulSoup
      2 import requests
----> 3 import src.utils as utils
      4 import pandas as pd
      5 import logging as logging

ModuleNotFoundError: No module named 'src'

Change

import src.utils as utils

to

import vnquant.utils as utils

will fix it.

Error: IndexError: list index out of range

df = loader.download();=> error line
i used your library. show error. help me. my source code:

def load_data(ticker, n_steps=50, scale=True, shuffle=True, lookup_step=1,
test_size=0.2, feature_columns=['close', 'volume', 'open', 'high', 'low']):
loader = web.DataLoader(ticker, start="2000-01-01", end="2020-06-24", minimal=True, data_source="vnd")
# see if ticker is already a loaded stock from yahoo finance
if isinstance(ticker, str):
# load it from yahoo_fin library
# df = si.get_data(ticker)
df = loader.download();
elif isinstance(ticker, pd.DataFrame):
# already loaded, use it directly
df = ticker
# this will contain all the elements we want to return from this function
result = {}
# we will also return the original dataframe itself
result['df'] = df.copy()
# make sure that the passed feature_columns exist in the dataframe
for col in feature_columns:
assert col in df.columns, f"'{col}' does not exist in the dataframe."
if scale:
column_scaler = {}
# scale the data (prices) from 0 to 1
for column in feature_columns:
scaler = preprocessing.MinMaxScaler()
df[column] = scaler.fit_transform(df[column].values)
# df[column] = scaler.fit_transform(np.expand_dims(df[column].values, axis=1))
column_scaler[column] = scaler

    # add the MinMaxScaler instances to the result returned
    result["column_scaler"] = column_scaler
# add the target column (label) by shifting by `lookup_step`
df['future'] = df['close'].shift(-lookup_step)
# last `lookup_step` columns contains NaN in future column
# get them before droping NaNs
last_sequence = np.array(df[feature_columns].tail(lookup_step))
# drop NaNs
df.dropna(inplace=True)
sequence_data = []
sequences = deque(maxlen=n_steps)
for entry, target in zip(df[feature_columns].values, df['future'].values):
    sequences.append(entry)
    if len(sequences) == n_steps:
        sequence_data.append([np.array(sequences), target])
# get the last sequence by appending the last `n_step` sequence with `lookup_step` sequence
# for instance, if n_steps=50 and lookup_step=10, last_sequence should be of 59 (that is 50+10-1) length
# this last_sequence will be used to predict in future dates that are not available in the dataset
last_sequence = list(sequences) + list(last_sequence)
# shift the last sequence by -1
last_sequence = np.array(pd.DataFrame(last_sequence).shift(-1).dropna())
# add to result
result['last_sequence'] = last_sequence
# construct the X's and y's
X, y = [], []
for seq, target in sequence_data:
    X.append(seq)
    y.append(target)
# convert to numpy arrays
X = np.array(X)
y = np.array(y)
# reshape X to fit the neural network
X = X.reshape((X.shape[0], X.shape[2], X.shape[1]))
# split the dataset
result["X_train"], result["X_test"], result["y_train"], result["y_test"] = train_test_split(X, y, test_size=test_size, shuffle=shuffle)
# return the result
return result

UnicodeDecodeError

Em cài trên máy local bị lỗi này làm sao để fix vậy anh?
Loi

Run test fail

F:\PROJECT\vnquant-master\vnquant\DataLoader.py:256: FutureWarning: Columnar iteration over characters will be deprecated in future releases.
stock_data['change_perc1'], stock_data['change_perc2'] = stock_data['change_perc'].apply(utils.split_change_col).str

ValueError Traceback (most recent call last)
in
2 import vnquant.DataLoader as dl
3 loader = dl.DataLoader('VND', '2018-02-02','2018-04-02')
----> 4 loader.download()
5
6 # Test visualizatioin

F:\PROJECT\vnquant-master\vnquant\DataLoader.py in download(self)
36 else:
37 loader = DataLoaderCAFE(self.symbols, self.start, self.end)
---> 38 stock_data = loader.download()
39 # logging.info('Data CAFE: {}'.format(stock_data))
40

F:\PROJECT\vnquant-master\vnquant\DataLoader.py in download(self)
231
232 for symbol in symbols:
--> 233 stock_datas.append(self.download_one(symbol))
234
235 data = pd.concat(stock_datas, axis=1)

F:\PROJECT\vnquant-master\vnquant\DataLoader.py in download_one(self, symbol)
254 break
255
--> 256 stock_data['change_perc1'], stock_data['change_perc2'] = stock_data['change_perc'].apply(utils.split_change_col).str
257 if 'change_perc' in stock_data.columns:
258 stock_data.pop('change_perc')

ValueError: not enough values to unpack (expected 2, got 0)

Báo lỗi Json decode khi lấy giá của nhiều cổ phiếu

Em lấy giá của tất cả cổ phiếu sàn HOSE thì bị lỗi như sau.

#lấy danh sách các mã trên sàn HOSE
df = vnstock.listing_companies()
all_stock = np.asarray(df[(df.group_code == 'VNINDEX') & (df.ticker.str.len() == 3)]['ticker'])

#lấy giá cổ phiếu
loader = dt.DataLoader(symbols=all_stock,
start="2022-01-01",
end="2022-12-05",
minimal=True,
data_source="vnd")
data = loader.download()


JSONDecodeError Traceback (most recent call last)
in
6 minimal=True,
7 data_source="vnd")
----> 8 data = loader.download()
9 data.tail()

6 frames
/usr/lib/python3.8/json/decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Setup fail

Hello bạn, tôi setup thì báo lỗi dưới, dù đã cài đủ lib rồi

F:\PROJECT\vnquant-master>python setup.py install
F:\PROJECT\vnquant-master\setup.py:12: DeprecationWarning: Due to possible ambiguity, 'convert()' is deprecated. Use 'convert_file()' or 'convert_text()'.
read_md = lambda f: convert(f, 'rst')
See http://johnmacfarlane.net/pandoc/installing.html
for installation options

Traceback (most recent call last):
File "F:\PROJECT\vnquant-master\setup.py", line 33, in
long_description=read_md('README.md'),
File "F:\PROJECT\vnquant-master\setup.py", line 12, in
read_md = lambda f: convert(f, 'rst')
File "F:\PROJECT\Python3.9\lib\site-packages\pypandoc_init_.py", line 67, in convert
return convert_input(source, format, input_type, to, extra_args=extra_args,
File "F:\PROJECT\Python3.9\lib\site-packages\pypandoc_init
.py", line 256, in _convert_input
ensure_pandoc_path()
File "F:\PROJECT\Python3.9\lib\site-packages\pypandoc_init
.py", line 548, in _ensure_pandoc_path
raise OSError("No pandoc was found: either install pandoc and add it\n"
OSError: No pandoc was found: either install pandoc and add it
to your PATH or or call pypandoc.download_pandoc(...) or
install pypandoc wheels with included pandoc.

F:\PROJECT\vnquant-master>pip install pypandoc pandoc
Requirement already satisfied: pypandoc in f:\project\python3.9\lib\site-packages (1.5)
Requirement already satisfied: pandoc in f:\project\python3.9\lib\site-packages (1.0.2)
Requirement already satisfied: pip>=8.1.0 in f:\project\python3.9\lib\site-packages (from pypandoc) (21.1.1)
Requirement already satisfied: setuptools in f:\project\python3.9\lib\site-packages (from pypandoc) (56.0.0)
Requirement already satisfied: wheel>=0.25.0 in f:\project\python3.9\lib\site-packages (from pypandoc) (0.36.2)
Requirement already satisfied: ply in f:\project\python3.9\lib\site-packages (from pandoc) (3.11)

Không lấy được dữ liệu giá cổ phiếu sàn Upcom từ nguồn cafef

Mình lấy giá cổ phiếu sàn Upcom như sau:
loader = dt.DataLoader('BSR', '2000-01-01','2022-06-03')
df = loader.download()

Báo lỗi:
`File ~\Anaconda3\lib\site-packages\vnquant-0.0.3-py3.9.egg\vnquant\data\dataloader.py:256 in download_one
stock_data['change_perc1'], stock_data['change_perc2'] = stock_data['change_perc'].apply(utils.split_change_col).str

ValueError: not enough values to unpack (expected 2, got 1)`

New error

import vnquant.DataLoader as web
loader = web.DataLoader('VND', '2018-02-02','2018-04-02')
data = loader.download()
data.head()

ValueError Traceback (most recent call last)
in
1 import vnquant.DataLoader as web
2 loader = web.DataLoader('VND', '2018-02-02','2018-04-02')
----> 3 data = loader.download()
4 data.head()

~/opt/anaconda3/lib/python3.8/site-packages/vnquant-0.0.2-py3.8.egg/vnquant/DataLoader.py in download(self)
30 else:
31 loader = DataLoaderCAFE(self.symbols, self.start, self.end)
---> 32 stock_data = loader.download()
33 # logging.info('Data CAFE: {}'.format(stock_data))
34

~/opt/anaconda3/lib/python3.8/site-packages/vnquant-0.0.2-py3.8.egg/vnquant/DataLoader.py in download(self)
185
186 for symbol in symbols:
--> 187 stock_datas.append(self.download_one(symbol))
188
189 data = pd.concat(stock_datas, axis=1)

~/opt/anaconda3/lib/python3.8/site-packages/vnquant-0.0.2-py3.8.egg/vnquant/DataLoader.py in download_one(self, symbol)
208 break
209
--> 210 stock_data['change_perc1'], stock_data['change_perc2'] = stock_data.change_perc.apply(utils.split_change_col).str
211 if 'change_perc' in stock_data.columns:
212 stock_data.pop('change_perc')

ValueError: not enough values to unpack (expected 2, got 0)

Lỗi khi chọn data source cafe

Hi bạn,
Trong quá trình làm khi cố gắng lấy data từ cafe thì bị báo lỗi, mình đổi lại vnd thì bình thường. Mình có đính kèm ảnh https://ibb.co/r4j7wLP
ImportError: lxml not found, please install it, mặc dù đã cài rồi. Không biết mình còn thiếu thư viện nào không? Mình đang dùng python 3.8. Rất mong bạn giúp đỡ. Cảm ơn!

New method to get stocks data from VNDirect

Right now, we can crawl VNDirect's stocks data directly through their new Rest API for faster speed.
This is my function to fetch API

def crawl_one_symbol(symbol, start_date, end_date):
        API_VNDIRECT = 'https://finfo-api.vndirect.com.vn/v4/stock_prices/'
        query = 'code:' + symbol + '~date:gte:' + start_date + '~date:lte:' + end_date
        delta = datetime.strptime(end_date, '%Y-%m-%d') - datetime.strptime(start_date, '%Y-%m-%d')
        params = {
            "sort": "date",
            "size": delta.days + 1,
            "page": 1,
            "q": query
        }
        res = requests.get(API_VNDIRECT, params=params)
        data = res.json()['data']
        return data

Connection Error for Report Loader

Hi,

Can you help me to check API of VNDirect to crawl report? I cannot run any of FinanceLoader's functions, including:

  • get_basic_index()
  • get_finan_report()
  • get_business_report()
  • get_cashflow_report()

The common error is
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='finfo-api.vndirect.com.vn', port=443)...(Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001B1F389F970>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

Báo lỗi với symbol = 'VN100-INDEX' và data_source= 'cafe'

TypeError Traceback (most recent call last)
Cell In[44], line 7
1 loader = dt.DataLoader(symbols='VN100-INDEX',
2 start='2022-01-01',
3 end=end_time,
4 minimal=True,
5 data_source="cafe")
----> 7 data = loader.download()
8 data.tail()

File ~.conda\envs\stock\lib\site-packages\vnquant-0.1.1-py3.10.egg\vnquant\data\dataloader.py:36, in DataLoader.download(self)
32 # logging.info('Data Symbols: {}, start: {}, end: {}'.format(stock_data, start, end))
33 # logging.info('Data VND: {}'.format(stock_data))
34 else:
35 loader = DataLoaderCAFE(self.symbols, self.start, self.end)
---> 36 stock_data = loader.download()
37 # logging.info('Data CAFE: {}'.format(stock_data))
39 if self.minimal:
40 # logging.info(stock_data)

File ~.conda\envs\stock\lib\site-packages\vnquant-0.1.1-py3.10.egg\vnquant\data\dataloader.py:231, in DataLoaderCAFE.download(self)
228 symbols = self.symbols
230 for symbol in symbols:
--> 231 stock_datas.append(self.download_one(symbol))
233 data = pd.concat(stock_datas, axis=1)
234 return data

File ~.conda\envs\stock\lib\site-packages\vnquant-0.1.1-py3.10.egg\vnquant\data\dataloader.py:254, in DataLoaderCAFE.download_one(self, symbol)
251 if is_touch_end:
252 break
--> 254 stock_data['change_perc1'], stock_data['change_perc2'] = stock_data['change_perc'].apply(utils.split_change_col).str
255 if 'change_perc' in stock_data.columns:
256 stock_data.pop('change_perc')

File ~.conda\envs\stock\lib\site-packages\pandas-1.5.2-py3.10-win-amd64.egg\pandas\core\series.py:4771, in Series.apply(self, func, convert_dtype, args, **kwargs)
4661 def apply(
4662 self,
4663 func: AggFuncType,
(...)
4666 **kwargs,
4667 ) -> DataFrame | Series:
4668 """
4669 Invoke function on values of Series.
4670
(...)
4769 dtype: float64
4770 """
-> 4771 return SeriesApply(self, func, convert_dtype, args, kwargs).apply()

File ~.conda\envs\stock\lib\site-packages\pandas-1.5.2-py3.10-win-amd64.egg\pandas\core\apply.py:1105, in SeriesApply.apply(self)
1102 return self.apply_str()
1104 # self.f is Callable
-> 1105 return self.apply_standard()

File ~.conda\envs\stock\lib\site-packages\pandas-1.5.2-py3.10-win-amd64.egg\pandas\core\apply.py:1156, in SeriesApply.apply_standard(self)
1154 else:
1155 values = obj.astype(object)._values
-> 1156 mapped = lib.map_infer(
1157 values,
1158 f,
1159 convert=self.convert_dtype,
1160 )
1162 if len(mapped) and isinstance(mapped[0], ABCSeries):
1163 # GH#43986 Need to do list(mapped) in order to get treated as nested
1164 # See also GH#25959 regarding EA support
1165 return obj._constructor_expanddim(list(mapped), index=obj.index)

File ~.conda\envs\stock\lib\site-packages\pandas-1.5.2-py3.10-win-amd64.egg\pandas_libs\lib.pyx:2918, in pandas._libs.lib.map_infer()

File ~.conda\envs\stock\lib\site-packages\vnquant-0.1.1-py3.10.egg\vnquant\utils\utils.py:22, in split_change_col(text)
21 def split_change_col(text):
---> 22 return re.sub(r'[(|)%]', '', text).strip().split()

File ~.conda\envs\stock\lib\re.py:209, in sub(pattern, repl, string, count, flags)
202 def sub(pattern, repl, string, count=0, flags=0):
203 """Return the string obtained by replacing the leftmost
204 non-overlapping occurrences of the pattern in string by the
205 replacement repl. repl can be either a string or a callable;
206 if a string, backslash escapes in it are processed. If it is
207 a callable, it's passed the Match object and must return
208 a replacement string to be used."""
--> 209 return _compile(pattern, flags).sub(repl, string, count)

TypeError: expected string or bytes-like object

Error ModuleNotFoundError: No module named 'bs4'

help me !
I run then error: "ModuleNotFoundError: No module named 'bs4'"

Code:
from vnquant.DataLoader import DataLoader

loader = DataLoader(symbols="VN30",
start="2019-01-01",
end="2019-12-09",
minimal=False,
data_source="vnd")

data = loader.download()
data.head()

Lỗi với get_business_report()

Mình chạy phần này trong file test.py

import vnquant.data as dt
loader = dt.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True)
data_business = loader.get_business_report()
print(data_business.head())
data_business.head().to_html('data_business.html')

thì gặp lỗi:

Traceback (most recent call last):
File "/home/tananh/miniconda3/envs/vnquant2/lib/python3.8/site-packages/requests/models.py", line 960, in json
return complexjson.loads(self.content.decode(encoding), **kwargs)
File "/home/tananh/miniconda3/envs/vnquant2/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/home/tananh/miniconda3/envs/vnquant2/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/tananh/miniconda3/envs/vnquant2/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 10, in
data_business = loader.get_business_report()
File "/mnt/e/Finance_noobies/vnquant/vnquant/data/finance.py", line 59, in get_business_report
data = page.json()
File "/home/tananh/miniconda3/envs/vnquant2/lib/python3.8/site-packages/requests/models.py", line 968, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Lỗi này gặp phải với get_business_report(), get_finan_report(), và get_cashflow_report(). Bạn có thể xem qua phần này được không?

Cannot clone VN30 or another Indices with "VND" datasource

from vnquant import DataLoader as crawler
loader = crawler.DataLoader(symbols="VN30", start="2021-01-01", end="2021-07-01", minimal=True, data_source="vnd")
temp_df = loader.download()

image

KeyError: "None of [Index(['date', 'adClose', 'close', 'pctChange', 'average', 'nmVolume',\n 'nmValue', 'ptVolume', 'ptValue', 'open', 'high', 'low'],\n dtype='object')] are in the [columns]"

Error parsing

Hello , today i have run
$ python test.py
error
l```
oader.download()
File "/root/vnquant/vnquant/DataLoader.py", line 26, in download
stock_data = loader.download()
File "/root/vnquant/vnquant/DataLoader.py", line 67, in download
stock_datas.append(self.download_one(symbol))
File "/root/vnquant/vnquant/DataLoader.py", line 77, in download_one
last_page = self.get_last_page(symbol)
File "/root/vnquant/vnquant/DataLoader.py", line 164, in get_last_page
text_div = soup.find_all('div', {'class': 'paging'})[-1].get_text()

Lỗi cài thư viện khi push heroku

Mình đang làm một web app sử dụng vnquant nhưng khi push to heroku thì bị lỗi không cài được vnquant. Trong requirements.txt mình có thử cài thằng link trên github thì bị báo lỗi không có numpy trong khi pip list mình có cài rồi. Khi cài bằng vnquant==0.0.3 thì không tìm thấy. Mình phải làm sao để cài được lên heroku vậy ạ?

Error

from vnquant.DataLoader import DataLoader

DataLoader(symbols="VND",
start="2018-01-10",
end="2018-02-15",
data_source="cafe",
minimal=True)

data = DataLoader.download()

TypeError Traceback (most recent call last)
in
7 minimal=True)
8
----> 9 data = DataLoader.download()

TypeError: download() missing 1 required positional argument: 'self'

Cannot get data from VNDirect

Please check the function download_one_new of DataLoaderVND.

When running res = requests.get(API_VNDIRECT, params=params), I found out value of res is <Response [403]>.

Báo lỗi 'Length mismatch: Expected axis has 4 elements, new values have 12 elements"

Tôi gặp phải lỗi "Length mismatch: Expected axis has 4 elements, new values have 12 elements" khi chạy đoạn code sau: "import vnquant.data as dt
START = "2018-01-10"
TODAY = "2018-02-15"
loader = dt.DataLoader(symbols="VND",
start=START,
end=TODAY,
minimal=True,
data_source="cafe")

Download the data using the loader

data = loader.download()

Display the data as a Pandas DataFrame

print(data)". Đây là full output: " data = loader.download()
^^^^^^^^^^^^^^^^^
File "C:\Users\duong\anaconda3\Lib\site-packages\vnquant-0.1.1-py3.11.egg\vnquant\data\dataloader.py", line 36, in download
stock_data = loader.download()
^^^^^^^^^^^^^^^^^
File "C:\Users\duong\anaconda3\Lib\site-packages\vnquant-0.1.1-py3.11.egg\vnquant\data\dataloader.py", line 231, in download
stock_datas.append(self.download_one(symbol))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\duong\anaconda3\Lib\site-packages\vnquant-0.1.1-py3.11.egg\vnquant\data\dataloader.py", line 242, in download_one
stock_slice_batch = self.download_batch(i + 1, symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\duong\anaconda3\Lib\site-packages\vnquant-0.1.1-py3.11.egg\vnquant\data\dataloader.py", line 295, in download_batch
stock_slice_batch.columns = ['date', 'adjust', 'close', 'change_perc', 'avg',
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\duong\anaconda3\Lib\site-packages\pandas\core\generic.py", line 5915, in setattr
return object.setattr(self, name, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas_libs\properties.pyx", line 69, in pandas._libs.properties.AxisProperty.set
File "C:\Users\duong\anaconda3\Lib\site-packages\pandas\core\generic.py", line 823, in _set_axis
self._mgr.set_axis(axis, labels)
File "C:\Users\duong\anaconda3\Lib\site-packages\pandas\core\internals\managers.py", line 230, in set_axis
self._validate_set_axis(axis, new_labels)
File "C:\Users\duong\anaconda3\Lib\site-packages\pandas\core\internals\base.py", line 70, in _validate_set_axis
raise ValueError(
ValueError: Length mismatch: Expected axis has 4 elements, new values have 12 elements".

Không lấy được số lượng cổ phiếu lưu hành của các ngân hàng

Khi lấy dữ liệu từ lệnh get_finan_report() của các ngân hàng (ACB, CTG...) thì kết quả không trả về số lượng Cổ phiếu lưu hành.

Mình hiểu là khi gọi lệnh get_finan_report() với các mã ngân hàng thì sẽ trả về dữ liệu khác với các mã cổ phiếu thông thường. Không biết có cách nào lấy được số lượng cổ phiếu lưu hành của các ngân hàng không?

Ngoài ra, với các mã thông thường, số lượng cổ phiếu lưu hành được trả về ở row có index = ''Cổ phiếu phổ thông" thì số lượng bị nhân lên 10.000 lần.
VD: AAA có số lượng cổ phiếu lưu hành là 326,434,496
Dữ liệu trả về ở row "Cổ phiếu phổ thông": 3,264,344,960,000

Setup fail - bs4

Mình xử lý được lỗi pypandoc rồi, thì giờ lại lòi ra món này

error: Could not find suitable distribution for Requirement.parse('bs4>=4.9.3')

Bs4 thì mới có phiên bản 0.0.1, làm gì có 4.9.3 nhỉ?
https://pypi.org/simple/bs4/

F:\PROJECT\vnquant-master>pip install bs4
Requirement already satisfied: bs4 in f:\project\python3.9\lib\site-packages (0.0.1)
Requirement already satisfied: beautifulsoup4 in f:\project\python3.9\lib\site-packages (from bs4) (4.9.3)
Requirement already satisfied: soupsieve>1.2 in f:\project\python3.9\lib\site-packages (from beautifulsoup4->bs4) (2.2.1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.