Skip to content

Commit

Permalink
Fix warnings(#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
josw123 committed Sep 7, 2020
1 parent da514a1 commit 29e7604
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dart_fss/fs/fs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pandas as pd

from pandas import DataFrame
from typing import Dict
from typing import Dict, Optional

from dart_fss.utils import dict_to_html, create_folder

Expand Down Expand Up @@ -42,7 +42,7 @@ def separator(self, separator):
pd.options.display.float_format = '{:}'.format
self.info['separator'] = separator

def show(self, tp, show_class: bool = True, show_depth: int = 10, show_concept: bool = True) -> DataFrame:
def show(self, tp, show_class: bool = True, show_depth: int = 10, show_concept: bool = True) -> Optional[DataFrame]:
"""
재무제표 정보를 표시해주는 Method
Expand Down Expand Up @@ -75,6 +75,8 @@ class 표시 여부
for column in columns:
if column not in class_columns:
ncolumns.append(column)
if len(ncolumns) > 0:
ncolumns = pd.MultiIndex.from_tuples(ncolumns)
df = df[ncolumns]
else:
drop_rows = []
Expand All @@ -88,7 +90,8 @@ class 표시 여부
for column in columns:
if column not in class_columns[show_depth + 1:]:
ncolumns.append(column)

if len(ncolumns) > 0:
ncolumns = pd.MultiIndex.from_tuples(ncolumns)
df = df[ncolumns].drop(drop_rows)

if show_concept is False:
Expand All @@ -99,6 +102,8 @@ class 표시 여부
for column in columns:
if column not in concept_colmuns:
ncolumns.append(column)
if len(ncolumns) > 0:
ncolumns = pd.MultiIndex.from_tuples(ncolumns)
df = df[ncolumns]
return df

Expand Down
2 changes: 2 additions & 0 deletions dart_fss/xbrl/dart_xbrl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import re
import pandas as pd
from typing import List, Union

from pandas import DataFrame
Expand Down Expand Up @@ -124,6 +125,7 @@ def get_period_information(self, lang: str = 'ko') -> DataFrame:
data = df[df.columns[2:]].iloc[3]
data_set = [(key, data[key]) for key in data.keys()]
new_columns = list(df.columns[:2]) + [data[0] for data in sorted(data_set, key=lambda x: x[1], reverse=True)]
new_columns = pd.MultiIndex.from_tuples(new_columns)
return df[new_columns]

def get_audit_information(self, lang: str = 'ko') -> DataFrame:
Expand Down

0 comments on commit 29e7604

Please sign in to comment.