We already understood the data health check up, and EDA in part 1. In part 2, we understood the different kind of feature selection techniques. In Part 3, we built different models , analyzed & compared the performance. In part 4, we understood the two optimization approaches.
Now, in this tutorial, we will try to understand deploying method using Flask APIs and Heroku.
We are using Python 3.8.3, you can use any version.
pip install virtualenv, please check resources below for environment setup.
pip install flask
pip install -r requirements.txt, can be found here
Create your account on Heroku | Sign up, then create new app and name it. …
The main objective of this tutorial is to find the best method to import bulk CSV data into MySQL.
Python 3.8.3 : Anaconda download link
MySQL : Download link
sqlalchemy : To install sqlalchemy use the command: pip install sqlalchemy
To begin, prepare or identify the CSV file that you’d like to import to MySQL database. For example, we loaded iris data from GitHub.
import os
import sys
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
import seaborn as sns
import matplotlib.pyplot as plt
import mysql.connector as msql
from mysql.connector import Error
import csv
3.2 Extract the…
Comparison of Methods for Importing bulk CSV data Into PostgreSQL Using Python
The main objective of this tutorial is to find the best method to import bulk CSV data into PostgreSQL.
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
import os
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras as extras
import pandas as pd
from io import StringIO
import numpy as np
from sqlalchemy import create_engine
import seaborn as sns
import matplotlib.pyplot …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
The main objective of this article is to learn step by step working code for the to_sql() method.
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
import os
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2, petl
Generally we create training and testing data by importing csv file into pandas DataFrame but when we have large data stored in database server then we need a method to extract it into pandas DataFrame directly from database server. For this objective, we will learn step by step working code for different methods for doing it.
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
Generally we create training and testing data by importing csv file into pandas DataFrame but when we have large data stored in database server then we need a method to extract it into pandas DataFrame directly from database server. For this objective, we will learn step by step working code for different methods for doing it.
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
The main objective of this article is to learn step by step working code for the copy_from() with StringIO method.
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
import os
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
The main objective of this article is to learn step by step working code for the copy_from() method.
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras as extras
import pandas as pd
irisData = pd.read_csv('https://raw.githubusercontent.com/Muhd-Shahid/Learn-Python-Data-Access/main/iris.csv',index_col=False) …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
The main objective of this article is to learn step by step working code for the mogrify() method.
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras as extras
import pandas as pdirisData = pd.read_csv('https://raw.githubusercontent.com/Muhd-Shahid/Learn-Python-Data-Access/main/iris.csv',index_col=False) …
Python 3.8.3 : Anaconda download link
PostgreSQL 13 : Download link
Psycopg2 : To install Psycopg2 use the command: pip install psycopg2
The main objective of this article is to learn step by step working code for the execute_values() method.
To begin, prepare or identify the CSV file that you’d like to import to PostgreSQL database. For example, we loaded iris data from GitHub.
# import sys to get more detailed Python exception info
import sys
# import the connect library for psycopg2
import psycopg2
# import the error handling libraries for psycopg2
from psycopg2 import OperationalError, errorcodes, errors
import psycopg2.extras …
About