Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Visualization MySQL data in Jupyter Notebook
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pymysql\n",
"import pandas as pd\n",
"\n",
"host = os.getenv('MYSQL_HOST')\n",
"port = os.getenv('MYSQL_PORT')\n",
"user = os.getenv('MYSQL_USER')\n",
"password = os.getenv('MYSQL_PASSWORD')\n",
"database = os.getenv('MYSQL_DATABASE')\n",
"\n",
"conn = pymysql.connect(\n",
" host=host,\n",
" port=int(port),\n",
" user=user,\n",
" passwd=password,\n",
" db=database,\n",
" charset='utf8mb4')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>date</th>\n",
" <th>count</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>2017-05-22</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>2017-05-24</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>2017-05-25</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>2017-05-26</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>2017-05-27</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>2017-05-28</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>2017-05-29</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>2017-05-30</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>2017-05-31</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>2017-06-01</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" date count\n",
"35 2017-05-22 3\n",
"36 2017-05-24 1\n",
"37 2017-05-25 1\n",
"38 2017-05-26 1\n",
"39 2017-05-27 1\n",
"40 2017-05-28 1\n",
"41 2017-05-29 4\n",
"42 2017-05-30 1\n",
"43 2017-05-31 1\n",
"44 2017-06-01 1"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.read_sql_query(\n",
" \"SELECT DATE(created_at) AS date, COUNT(*) AS count FROM user GROUP BY date HAVING date >= '2017-04-01' \",\n",
" conn)\n",
"df.tail(10)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAE6CAYAAADtBhJMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHRRJREFUeJzt3Xu4XAV57/HvjyQQMDkgyT4I7MRNhXpBkyC7weLhIYT6\nNF5KaA2nCKYJB9lHHwE9tlXwQivytHi0GrkcaSpysTxcjJeTIpdDm1CLBwJJIIEQoJETYSOFkGCA\nIpDAe/6YFdgd92Zm7z175p01v8/zzOOatdae+SbBN5M1a9YoIjAzs3LZrdUBZmbWeB7uZmYl5OFu\nZlZCHu5mZiXk4W5mVkIe7mZmJeThbmZWQh7uZmYl5OFuZlZC41v1xFOnTo2enp5WPb2ZWVtas2bN\nUxHRVWu/lg33np4eVq9e3aqnNzNrS5J+Uc9+PixjZlZCHu5mZiXk4W5mVkItO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hqp1kp8Cx0vaU9Jk4A+K9ZOBxyVNAE4esP+zxTYi4hng/0k6AUAV\nM5uXbjY8Hu7WMSJiLXAtsA64Ebir2PQlYBXwM2DgG6TXAH8u6W5Jb6Ey+E+VtA7YAMxvVrvZcPkN\nVTOzEvIrdzOzEvJwNzMrIQ93M7MS8nA3MyshD3czsxLycDczKyEPdzOzEvJwNzMrof8PGXJ+tiq+\ngNMAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x10596def0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"\n",
"df.index = df['date']\n",
"p = df.tail(10).plot.bar()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"conn.close()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.