Skip to content

Commit

Permalink
way to try with no key
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmanok committed May 26, 2018
1 parent 384a497 commit af3f3b5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
24 changes: 24 additions & 0 deletions blogs/pandas-pvtkey/nokey_query.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python

def query_to_dataframe(query):
import pandas as pd
return pd.read_gbq(query,
project_id='cloud-training-demos',
dialect='standard',
verbose=False)

query = """
SELECT
year,
COUNT(1) as num_babies
FROM
publicdata.samples.natality
WHERE
year > 2000
GROUP BY
year
"""

df = query_to_dataframe(query)
print(df.head())

27 changes: 25 additions & 2 deletions blogs/sklearn/babyweight_skl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,30 @@
"deletable": true,
"editable": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"jobId: babyweight_skl_20180526_184047\n",
"state: QUEUED\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Job [babyweight_skl_20180526_184047] submitted successfully.\n",
"Your job is still active. You may view the status of your job with the command\n",
"\n",
" $ gcloud ml-engine jobs describe babyweight_skl_20180526_184047\n",
"\n",
"or continue streaming the logs with the command\n",
"\n",
" $ gcloud ml-engine jobs stream-logs babyweight_skl_20180526_184047\n"
]
}
],
"source": [
"%bash\n",
"\n",
Expand All @@ -1048,7 +1071,7 @@
" --runtime-version=$RUNTIME_VERSION \\\n",
" --python-version=$PYTHON_VERSION \\\n",
" -- \\\n",
" --bucket=${BUCKET} --frac=1.0 --projectId $PROJECT"
" --bucket=${BUCKET} --frac=0.1 --projectId $PROJECT"
]
},
{
Expand Down

0 comments on commit af3f3b5

Please sign in to comment.