Skip to content

Commit add4409

Browse files
committed
feat(fuzzy_pharma): add 'get_client_data_frames()'
1 parent 61f1e9a commit add4409

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

data_in/clients/client_2.xls

-17 KB
Binary file not shown.

fuzzy_pharma/main.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pandas as pd
22

3-
from fuzzy_pharma.definitions import NOMENCLATURE
3+
from fuzzy_pharma.definitions import NOMENCLATURE, CLIENTS
44

55

66
def get_data_frames(nomenclature_dir, header=None):
@@ -15,8 +15,21 @@ def get_data_frames(nomenclature_dir, header=None):
1515
return df
1616

1717

18+
def get_client_data_frames(client_dir, usecols, header=0):
19+
client_files = client_dir.glob('*')
20+
21+
df = pd.DataFrame()
22+
23+
for client in client_files:
24+
c = pd.read_excel(client, header=header, usecols=usecols)
25+
df = pd.concat([df, c], ignore_index=True, axis=0)
26+
27+
return df
28+
29+
1830
def main():
1931
nomenclature_df = get_data_frames(NOMENCLATURE)
32+
clients_df = get_client_data_frames(CLIENTS, ['наименование'])
2033

2134

2235
if __name__ == '__main__':

0 commit comments

Comments
 (0)