Flask and JSON
It is possible to use the Flask framework to play with json data. The programme looks like: # import main Flask class and request object from flask import Flask, request…
It is possible to use the Flask framework to play with json data. The programme looks like: # import main Flask class and request object from flask import Flask, request…
Python has a module (Flask) that allows to run a Python module from the commmand line. The code looks like: # import main Flask class and request object from flask…
One may use the node.js server as a means to get acquainted with restful services. Let us assume this server is installed and started with json-server "C:\Users\tomva\SynologyDrive\python\json server\db.json" --port 8000…
Below, a script is provided that reads a CSV file and translate the outcome into a dataframe: import csv import pandas as pd with open(r"C:\Users\tomva\SynologyDrive\python\pandas\Incomplete\banking.csv","r") as csv_file: csv_reader = csv.reader(csv_file,…
Below, you see a snippet on how to create a plot in Pandas. import pandas as pd data = pd.read_csv(r"C:\Users\tomva\SynologyDrive\python\pandas\Incomplete\banking.csv", header = 0) deel = data.sample(frac =.005) ax1 = deel.plot.scatter(x='age',…
Below, you see a logistic regression with Panda import pandas as pd import numpy as np from sklearn import preprocessing import matplotlib.pyplot as plt plt.rc("font", size=14) from sklearn.linear_model import LogisticRegression…
Find below a Python programme that shows a crosstab whereby continuous variables are translated into classes: import pandas as pd import sqlalchemy as sa import matplotlib.pyplot as plt import numpy…
Below, a programme is given on the univariate statistics. import pandas as pd import sqlalchemy as sa import matplotlib.pyplot as plt import numpy as np table_name = 'MIGRATED_DIVORCE_SETTLEMENT__C' connection_string =…
Below, a programme is provided that shows the point cloud with a line that is the best fit to it. import pandas as pd import sqlalchemy as sa import matplotlib.pyplot…
Below, I read a table and I apply the ordinary least squares methode to it: import pandas as pd from sqlalchemy.engine import create_engine from sqlalchemy.engine import URL import sqlalchemy as…