[Tutor] creating a connection class

2018-03-30 Thread Glenn Schultz
All, I can create a connection as follows and it works but I think it is best to have a connection class that opens and closes.  I create the connection class as outline below.  However, it does not work - meaning that it does not return a connection rather it returns  <__main__.modelingdb at

[Tutor] pandas read sql query advice

2018-04-27 Thread Glenn Schultz
All, I have the following set-up (below) which will be used to call data from multiple sectors.  There is a sql query (transact sql) and connection.  This works fine.  However, I would like to parametrize the query so I can enter different sectors.  I have checked through pyodbc and several SO

[Tutor] PMML vs. Pickel

2018-05-07 Thread Glenn Schultz
All, have a Python prepayment model that must be integrated into 3rd party vendor software considering translating to PMML. I have been researching this. Any potential downside? Glenn Sent from my iPhone ___ Tutor maillist - Tutor@python.org To un

[Tutor] help with Pandas

2018-05-22 Thread Glenn Schultz
All, I have a dataframe with the column 'loanage' and a function to transform loanage, which will be part of a pipline, I am trying to apply the function to the data frame as follows: df['loanage'].apply(myfunction(x = 2, y = 10, z = 10, df['loanage]), axis = 0) I get value error: The truth i

[Tutor] adding numpy to pandas

2018-06-20 Thread Glenn Schultz
All, I have a pandas dataframe and a predict result (numpy array) of a classifier [[0,1],[1,0]].  What I would like to do is as the positive to the pandas dataframe.  I use predict[:,1] to slice the postive from numpy which gives me a row of the result.  but I cannot concat to the pandas df['r

[Tutor] Building a Package

2018-08-21 Thread Glenn Schultz via Tutor
All, I have a project pthon(3.7) I have followed the python setup instructions. I get a dist folder with the correct files.  Now, I would like to install locally from my local machine (note I am not using virtual enviroment as our firewall does not allow installation of packages when using VE).

[Tutor] build does not include all .py modules

2018-08-23 Thread Glenn Schultz via Tutor
All, followed links and suggestions and I have resolved most issues.  I continue to follow the python.org instructions as well.  The package builds and creates all the requsite files.  The challenge I am facing now is that the __init__.py does not include all the modules.  Below is a screen sho

[Tutor] building package on mac os

2018-09-09 Thread Glenn Schultz via Tutor
I have a package that I am working on.  I am using Pycharm.  The directories are set up correctly.   In my frameworks I have Python 2.7 Python 3.5 Python 3.6 Python 3.7 Current - which is Python 2.7 After navigating to the directory with the package I run the following in my terminal python3 s