thinh-vu / vnstock

A powerful Python library for getting rich data from the Vietnam Stock Market using just a few lines of code
https://vnstocks.com
Other
465 stars 127 forks source link

Income Statement trả về trùng lặp columns #132

Open yellow1912 opened 2 weeks ago

yellow1912 commented 2 weeks ago

Mình đang dùng bản mới nhất vnstock3 (tính đến thời điểm post lỗi này)

Các cột sau bị trùng

'Minority Interest', 'Dividends received', 'Provision for credit losses', 'Financial Income', 'Interest Expenses', 'Net Sales', 'Gross Profit', 'Financial Expenses', 'General & Admin Expenses', 'Operating Profit/Loss', 'Selling Expenses'

Index(['ticker', 'yearReport', 'lengthReport', 'Minority Interest',
       'Minority Interest', 'Net Profit/Loss before tax', 'Dividends received',
       'Dividends received', 'Provision for credit losses',
       'Provision for credit losses', 'Revenue YoY (%)', 'Revenue (Bn. VND)',
       'Attribute to parent company (Bn. VND)',
       'Attribute to parent company YoY (%)', 'Financial Income',
       'Financial Income', 'Interest Expenses', 'Interest Expenses',
       'Net Sales', 'Net Sales', 'Gross Profit', 'Gross Profit',
       'Financial Expenses', 'Financial Expenses', 'General & Admin Expenses',
       'General & Admin Expenses', 'Operating Profit/Loss',
       'Operating Profit/Loss', 'Net income from associated companies',
       'Other Income/Expenses', 'Cost of Sales', 'Selling Expenses',
       'Selling Expenses', 'Sales', 'Sales deductions',
       'Gain/(loss) from joint ventures', 'Other income',
       'Net other income/expenses', 'Interest and Similar Income',
       'Interest and Similar Expenses', 'Net Interest Income',
       'Fees and Comission Income', 'Fees and Comission Expenses',
       'Net Fee and Commission Income',
       'Net gain (loss) from foreign currency and gold dealings',
       'Net gain (loss) from trading of trading securities',
       'Net gain (loss) from disposal of investment securities',
       'Net Other income/(expenses)', 'Other expenses',
       'Net Other income/expenses', 'Total operating revenue',
       'Operating Profit before Provision', 'Profit before tax',
       'Tax For the Year', 'Business income tax - current',
       'Business income tax - deferred', 'Net Profit For the Year',
       'Attributable to parent company', 'EPS_basis'],
      dtype='object')
yellow1912 commented 2 weeks ago

Việc trùng lặp này xảy ra với nhiều reports khác ví dụ balance_sheet

thinh-vu commented 2 weeks ago

Chào @yellow1912, Cám ơn bạn đã báo lỗi. Bạn cho mình xin thêm các trường hợp lỗi cụ thể với các báo cáo mà bạn gặp thông tin lặp này nhé. Thực tế thì có những trường hợp tên cột giống nhau nhưng dữ liệu khác nhau (có quan hệ mục theo dạng cha-con) do đó mình không loại bỏ trùng ngay từ đầu. Phần này mình sẽ cần nghiên cứu thêm và đánh giá dựa trên các trường hợp mẫu cụ thể để xác định hướng cải thiện cho các phiên bản tới.

yellow1912 commented 2 weeks ago

Thực ra trên ví dụ của bạn cũng đã cho thấy việc bị lặp này, ví dụ

https://colab.research.google.com/github/thinh-vu/vnstock/blob/main/docs/1_vietnam_stock_vnstock3.ipynb#scrollTo=YbyOAOjy6Nfg

image

Nếu cột giống nhau nhưng dữ liệu khác nhau thì làm sao để biết cột nào là dữ liệu nào nhỉ? Phần cashflow này cũng không thấy quan hệ cha con.