Skip to content

Commit 19871bf

Browse files
author
ckdckd145
committed
before release 1.8.1.0
1 parent 050c32a commit 19871bf

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ For updates, please see [the notice in the documentation]((https://www.notion.so
4040

4141

4242
* Available functions to make figure or graph | 그래프 혹은 그림 제작에 활용되는 기능
43-
* P-P plot (Temporary)
44-
* Q-Q plot (Temporary)
43+
* P-P plot
44+
* Q-Q plot
45+
* Histogram
46+
* Histogram (cumulative)
47+
* Pointplot (within differences)
48+
* Boxplot (between group difference)
4549

4650
#### Dependency
4751
* pandas
@@ -50,6 +54,7 @@ For updates, please see [the notice in the documentation]((https://www.notion.so
5054
* numpy
5155
* matplotlib
5256
* seaborn
57+
* XlsxWriter
5358

5459
#### Recommendation
5560
Using "Jupyter Notebook" is <b>STRONGLY RECOMMENDED</b> (Of course, statmanager-kr works just as well in a Python environment)
@@ -63,7 +68,6 @@ Using "Jupyter Notebook" is <b>STRONGLY RECOMMENDED</b> (Of course, statmanager-
6368

6469

6570

66-
6771
# Development
6872

6973
* Contributor

statmanager/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Source codes are available in the [Github respository](https://github.com/ckdckd
2323

2424
For updates, please see [the notice in the documentation]((https://www.notion.so/cslee145/NOTICEs-4bb2177eeb0f412a81b8dbd3215058e6)) or the [Github release](https://github.com/ckdckd145/statmanager-kr/releases).
2525
업데이트 내역은 정식 문서 내 [공지사항](https://www.notion.so/cslee145/NOTICEs-4bb2177eeb0f412a81b8dbd3215058e6) 혹은 [Github release](https://github.com/ckdckd145/statmanager-kr/releases)에서 확인하시기 바랍니다.
26-
****
26+
2727

2828
#
2929
* [Quick Start with sample jupyter notebook file](https://github.com/ckdckd145/statmanager-kr/blob/main/test.ipynb)
@@ -40,8 +40,12 @@ For updates, please see [the notice in the documentation]((https://www.notion.so
4040

4141

4242
* Available functions to make figure or graph | 그래프 혹은 그림 제작에 활용되는 기능
43-
* P-P plot (Temporary)
44-
* Q-Q plot (Temporary)
43+
* P-P plot
44+
* Q-Q plot
45+
* Histogram
46+
* Histogram (cumulative)
47+
* Pointplot (within differences)
48+
* Boxplot (between group difference)
4549

4650
#### Dependency
4751
* pandas
@@ -50,6 +54,7 @@ For updates, please see [the notice in the documentation]((https://www.notion.so
5054
* numpy
5155
* matplotlib
5256
* seaborn
57+
* XlsxWriter
5358

5459
#### Recommendation
5560
Using "Jupyter Notebook" is <b>STRONGLY RECOMMENDED</b> (Of course, statmanager-kr works just as well in a Python environment)
@@ -63,7 +68,6 @@ Using "Jupyter Notebook" is <b>STRONGLY RECOMMENDED</b> (Of course, statmanager-
6368

6469

6570

66-
6771
# Development
6872

6973
* Contributor

statmanager/making_figure.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,65 @@ def show(self, only_result = False):
6969
print(n)
7070

7171
return self
72+
73+
def save(self, filename, file_format ='txt'):
74+
75+
if file_format == 'txt':
76+
content = []
77+
content.append(f'::: Note :::\n\nSaving Date : {TODAY}\nSaving Time : {NOW_TIME}\n\n')
78+
79+
showing_one = {
80+
'Testname' : self.testname,
81+
'Method': self.method,
82+
'Variables': self.vars,
83+
'Group_vars': self.group_vars,
84+
'Selector': self.selector,
85+
}
7286

87+
for key, value in showing_one.items():
88+
content.append(f"{key} : {value}")
89+
content.append("\n")
90+
91+
content.append("::: Original Reports :::\n\n")
92+
content.append(self.testname)
93+
94+
for n in self.result:
95+
if isinstance(n, str) or isinstance(n, list):
96+
content.append(str(n))
97+
elif isinstance(n, pd.DataFrame):
98+
content.append(n.to_string())
99+
100+
content_str = '\n'.join(content)
101+
102+
with open(f'{filename}.txt', 'w', encoding='utf-8') as file:
103+
file.write(content_str)
104+
105+
elif file_format == 'xlsx':
106+
writer = pd.ExcelWriter(f'{filename}.xlsx', engine='xlsxwriter')
107+
108+
basic_infos = {
109+
'Saving Date' : TODAY,
110+
'Saving Time' : NOW_TIME,
111+
'Testname' : self.testname,
112+
'method' : self.method,
113+
'variables' : self.vars,
114+
'Group_vars' : self.group_vars,
115+
'Selector' : self.selector,
116+
}
117+
118+
basic_infos = pd.DataFrame(list(basic_infos.items()), columns = ['type', 'info'])
119+
basic_infos.to_excel(writer, sheet_name='basic_info', index=False)
120+
121+
for i, item in enumerate(self.result):
122+
if isinstance(item, pd.DataFrame):
123+
item.to_excel(writer, sheet_name=f'result_{i + 1}')
124+
125+
writer.close()
126+
127+
else:
128+
raise ValueError("Unsupported fileformat. You must choose 'txt' or 'xlsx'.")
129+
130+
73131
def figure(self, method = 'auto'):
74132

75133
if method == 'auto':

statmanager/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
author_email='[email protected]',
1818
url='https://cslee145.notion.site/60cbfcbc90614fe990e02ab8340630cc?v=4991650ae5ce4427a215d1043802f5c0&pvs=4',
1919
download_url='https://github.com/ckdckd145/statmanager-kr',
20-
install_requires=['pandas', 'scipy', 'statsmodels', 'matplotlib', 'seaborn'],
20+
install_requires=['pandas', 'scipy', 'statsmodels', 'matplotlib', 'seaborn', 'XlsxWriter'],
2121
packages=find_packages(),
2222
keywords=['statistic', 'socialscience', 'stats',],
2323
python_requires='>=3.0',

0 commit comments

Comments
 (0)