case study about data_exchange from HDC database
- Install anaconda from www.anaconda.com
- Update anaconda -> conda update --all
- Upgrade python pip -> python -m pip install --upgrade pip
- Install pivottablejs -> 4.1 pip install pivottablejs 4.2 conda install pivottablejs
- Install package -> Open Anaconda Navigator install package - matplotlib, numpy, pandas, pivottable
- Install pymysql -> conda install -c anaconda pymysql
import os
import pymysql
import pandas as pd
host = os.getenv('Mysql_host')
port = os.getenv('Mysql_port')
user = os.getenv('Mysql_user')
password = os.getenv('Mysql_password')
database = os.getenv('Mysql_database')
conn = pymysql.connect(
host = host,
port = int(3306),
user = "root",
passwd = "",
db = "typearea_4",
chaset = "utf8mb4"
)
df = pd.read_sql_query("select * from typearea_4", conn)
df.tail(10)
-
Read csv file import pandas as pd df = pd.read_csv('data/typearea_4.csv') df.head()
-
pivot_ui import pandas as pd df = pd.read_csv('data/QueryTypearea_4JOIN.csv') from pivottablejs import pivot_ui pivot_ui(df) right click pop_out open in new tab
-
Past folder rdc_report in htdocs http://localhost/rdc_report
We will support you when we follow up
Thank you Good Luck
Natthawut Ponkrut : [email protected]