Skip to content

Commit 3165ab2

Browse files
committed
A first commit in this Studio.
0 parents  commit 3165ab2

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

INFORMATION/SHOWCASE004.cls.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Export generator="IRIS" version="26">
3+
<Class name="INFORMATION.SHOWCASE004">
4+
<Description>
5+
</Description>
6+
<Super>Ens.BusinessProcessBPL</Super>
7+
<TimeCreated>64998,2501.963342</TimeCreated>
8+
9+
<Storage name="Default">
10+
<Type>%Storage.Persistent</Type>
11+
</Storage>
12+
13+
<XData name="BPL">
14+
<Description>
15+
BPL Definition</Description>
16+
<XMLNamespace>http://www.intersystems.com/bpl</XMLNamespace>
17+
<Data><![CDATA[
18+
<process language='objectscript' request='Ens.Request' response='Ens.Response' component='1' height='2000' width='2000' >
19+
<sequence xend='200' yend='450' >
20+
<code name='Correlation Matrix: Tabular' xpos='200' ypos='250' >
21+
<annotation><![CDATA[import pyodbc
22+
import pandas as pd
23+
cnxn=pyodbc.connect(('DSN=IRIS(USER);UID=_SYSTEM;PWD=password'),autocommit=True)
24+
Data=pd.read_sql('SELECT * FROM SQLUser.CANNIBALIZATION_VOLUME_YEAR_WEEK_CATEGORY_DESC',cnxn)
25+
Data0=Data.drop(['WEEK'],axis=1)
26+
Data0['BRATWURST']=pd.to_numeric(Data0['BRATWURST'])
27+
Data0['CERVELAS']=pd.to_numeric(Data0['CERVELAS'])
28+
Data0['CHARCUTERIE']=pd.to_numeric(Data0['CHARCUTERIE'])
29+
Data0['DAUERFLEISCHWAREN']=pd.to_numeric(Data0['DAUERFLEISCHWAREN'])
30+
Data0['GEFLUEGEL']=pd.to_numeric(Data0['GEFLUEGEL'])
31+
Data0['GERAEUCHERTES_ZUM_KOCHEN']=pd.to_numeric(Data0['GERAEUCHERTES_ZUM_KOCHEN'])
32+
Data0['HACKFLEISCH']=pd.to_numeric(Data0['HACKFLEISCH'])
33+
Data0['INNEREIEN_DIVERSES']=pd.to_numeric(Data0['INNEREIEN_DIVERSES'])
34+
Data0['KALB']=pd.to_numeric(Data0['KALB'])
35+
Data0['KANINCHEN']=pd.to_numeric(Data0['KANINCHEN'])
36+
Data0['LAMM']=pd.to_numeric(Data0['LAMM'])
37+
Data0['MARINADEN']=pd.to_numeric(Data0['MARINADEN'])
38+
Data0['PASTETEN_TERRINEN_STREICHWURST']=pd.to_numeric(Data0['PASTETEN_TERRINEN_STREICHWURST'])
39+
Data0['PFANNENFERTIGES']=pd.to_numeric(Data0['PFANNENFERTIGES'])
40+
Data0['PFERD']=pd.to_numeric(Data0['PFERD'])
41+
Data0['RIND']=pd.to_numeric(Data0['RIND'])
42+
Data0['SALAMI_ROHWURST_AM_STUECK']=pd.to_numeric(Data0['SALAMI_ROHWURST_AM_STUECK'])
43+
Data0['SCHINKEN']=pd.to_numeric(Data0['SCHINKEN'])
44+
Data0['SCHWEIN']=pd.to_numeric(Data0['SCHWEIN'])
45+
Data0['UEBRIGE_BRUEHWURST_STUECK']=pd.to_numeric(Data0['UEBRIGE_BRUEHWURST_STUECK'])
46+
Data0['WIENERLI_KNACKERLI_FRANKFURTERLI']=pd.to_numeric(Data0['WIENERLI_KNACKERLI_FRANKFURTERLI'])
47+
corrmat=Data0.corr()
48+
corrmat.columns.name='CATEGORY'
49+
//PyRun_SimpleString("import sys
50+
//PyRun_SimpleString("orig_stdout=sys.stdout
51+
//PyRun_SimpleString("f=open('C:/IRIS+Python/IRIS+Python_output_model_001.txt','w')
52+
//PyRun_SimpleString("sys.stdout=f
53+
print(corrmat.to_string())
54+
//PyRun_SimpleString("sys.stdout=orig_stdout
55+
//PyRun_SimpleString("f.close()
56+
cnxn.close()]]]]><![CDATA[></annotation>
57+
<![CDATA[ Do ##class(CONVERGENCE.SHOWCASE004USE01).Go()]]]]><![CDATA[>
58+
</code>
59+
<code name='Correlation Matrix: Graph' xpos='200' ypos='350' >
60+
<annotation><![CDATA[import matplotlib
61+
import matplotlib.pyplot as plt
62+
import seaborn as sns
63+
f=plt.figure()
64+
sns.heatmap(corrmat,xticklabels=corrmat.columns,yticklabels=corrmat.columns)
65+
plt.title('Correlation analysis of category sales volumes (by year/month)')
66+
f.savefig('C:/IRIS+Python/SHOWCASE004USE02.png')
67+
plt.close(f)]]]]><![CDATA[></annotation>
68+
<![CDATA[ Do ##class(CONVERGENCE.SHOWCASE004USE02).Go()]]]]><![CDATA[>
69+
</code>
70+
</sequence>
71+
</process>
72+
]]></Data>
73+
</XData>
74+
</Class>
75+
</Export>

sc-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
INFORMATION.SHOWCASE004.cls

0 commit comments

Comments
 (0)