" headers = [x['VarCharValue'] for x in result['ResultSet']['Rows'][0]['Data']]\n",
" body = [x['Data'] for x in result['ResultSet']['Rows'][1:]]\n",
" rows = [[float(x['VarCharValue']) for x in x] for x in body]\n",
" return (headers,np.array(rows))"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "fde037bf-cc90-480d-b526-62209b94a3b8",
"metadata": {},
"outputs": [],
"source": [
"QUERY = 'SELECT vehicle_noise, vehicle_fuel FROM \"AwsDataCatalog\".\"crawled-database\".\"myawsbucket_npiphi\" where vehicle_fuel is Not null limit 1000';\n",
"QUERY = 'SELECT vehicle_noise, vehicle_fuel FROM \"AwsDataCatalog\".\"crawled-database\".\"myawsbucket_npiphi\" where vehicle_fuel is Not null limit 10000';\n",
"headers,rows = run_query(QUERY)\n",
"\n",
"plt.xlabel(headers[0])\n",
"plt.ylabel(headers[1])\n",
"plt.scatter(rows[:,0], rows[:,1])"
]
},
{
"cell_type": "code",
"execution_count": 80,
"id": "b1332efb-cfff-498b-a32d-348206890d0a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7feef9e46590>"
"QUERY = 'SELECT vehicle_PMx, vehicle_speed FROM \"AwsDataCatalog\".\"crawled-database\".\"myawsbucket_npiphi\" where vehicle_NOx is Not null and vehicle_NOx != 0 limit 10000';\n",
"headers,rows = run_query(QUERY)\n",
"\n",
"plt.xlabel(headers[0])\n",
"plt.ylabel(headers[1])\n",
"plt.scatter(rows[:,0], rows[:,1])"
]
},
{
"cell_type": "code",
"execution_count": 81,
"id": "5e5e93f6-d44b-4986-bd90-2f4f26c94b03",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7feef9b78760>"
"QUERY = 'SELECT vehicle_PMx, vehicle_NOx FROM \"AwsDataCatalog\".\"crawled-database\".\"myawsbucket_npiphi\" where vehicle_NOx is Not null and vehicle_NOx != 0 limit 10000';\n",
QUERY='SELECT vehicle_PMx, vehicle_speed FROM "AwsDataCatalog"."crawled-database"."myawsbucket_npiphi" where vehicle_NOx is Not null and vehicle_NOx != 0 limit 10000';
headers,rows=run_query(QUERY)
plt.xlabel(headers[0])
plt.ylabel(headers[1])
plt.scatter(rows[:,0],rows[:,1])
```
%% Output
<matplotlib.collections.PathCollection at 0x7feef9e46590>
QUERY='SELECT vehicle_PMx, vehicle_NOx FROM "AwsDataCatalog"."crawled-database"."myawsbucket_npiphi" where vehicle_NOx is Not null and vehicle_NOx != 0 limit 10000';
headers,rows=run_query(QUERY)
plt.xlabel(headers[0])
plt.ylabel(headers[1])
plt.scatter(rows[:,0],rows[:,1])
```
%% Output
<matplotlib.collections.PathCollection at 0x7feef9b78760>