{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":59575,"databundleVersionId":8060720,"sourceType":"competition"}],"dockerImageVersionId":30698,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import bq_helper\nfrom bq_helper import BigQueryHelper\npatents = BigQueryHelper(\"patents-public-data\", \"patents\")\npatents.list_tables()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-26T23:27:26.631355Z","iopub.execute_input":"2024-04-26T23:27:26.631781Z","iopub.status.idle":"2024-04-26T23:27:27.223172Z","shell.execute_reply.started":"2024-04-26T23:27:26.631749Z","shell.execute_reply":"2024-04-26T23:27:27.221967Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"patents.head(\"publications\", num_rows=3)","metadata":{"execution":{"iopub.status.busy":"2024-04-26T23:27:29.772890Z","iopub.execute_input":"2024-04-26T23:27:29.773515Z","iopub.status.idle":"2024-04-26T23:27:30.514506Z","shell.execute_reply.started":"2024-04-26T23:27:29.773468Z","shell.execute_reply":"2024-04-26T23:27:30.512938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"str(list(patents.head(\"publications\", num_rows=3).columns))","metadata":{"execution":{"iopub.status.busy":"2024-04-26T23:27:33.299165Z","iopub.execute_input":"2024-04-26T23:27:33.299583Z","iopub.status.idle":"2024-04-26T23:27:33.782075Z","shell.execute_reply.started":"2024-04-26T23:27:33.299550Z","shell.execute_reply":"2024-04-26T23:27:33.781260Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"extra_patent_details_sql = \"\"\"\nSELECT\n     * \n    FROM `patents-public-data.patents.publications` PUB\n    WHERE publication_number = 'US-10015385-B2'\n    LIMIT 1\n;\n\"\"\"\nprint('Query Size: ', patents.estimate_query_size(extra_patent_details_sql), 'GB')\nextra_patent_details = patents.query_to_pandas_safe(extra_patent_details_sql, max_gb_scanned=patents.estimate_query_size(extra_patent_details_sql))\n","metadata":{"execution":{"iopub.status.busy":"2024-04-26T23:44:26.993196Z","iopub.execute_input":"2024-04-26T23:44:26.993594Z","iopub.status.idle":"2024-04-26T23:44:32.997188Z","shell.execute_reply.started":"2024-04-26T23:44:26.993561Z","shell.execute_reply":"2024-04-26T23:44:32.996097Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"extra_patent_details","metadata":{"execution":{"iopub.status.busy":"2024-04-26T23:44:32.999266Z","iopub.execute_input":"2024-04-26T23:44:32.999630Z","iopub.status.idle":"2024-04-26T23:44:33.062869Z","shell.execute_reply.started":"2024-04-26T23:44:32.999601Z","shell.execute_reply":"2024-04-26T23:44:33.061749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"extra_patent_details.to_dict()","metadata":{"execution":{"iopub.status.busy":"2024-04-26T23:46:14.989747Z","iopub.execute_input":"2024-04-26T23:46:14.990224Z","iopub.status.idle":"2024-04-26T23:46:15.011825Z","shell.execute_reply.started":"2024-04-26T23:46:14.990178Z","shell.execute_reply":"2024-04-26T23:46:15.010407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}