{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Introduction","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"introduction","__idx":0},"children":["Introduction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this tutorial we will explain:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["How to get bulk statistics on WellLog data created"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["How to fetch WellLog bulk statistics code examples"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note: Computable WellLog's curves data types are: integer, float and date/datetime."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Computable WellLog's curves data types are: integer, float and date/datetime."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"required-python-packages","__idx":2},"children":["Required Python packages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before to start to write bulk data through Wellbore DDMS API's, you will need to install the Python packages below:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The pandas module and its Pandas.Dataframe json format to structure log bulk data to be written to the Wellbore DDMS."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The pyarrow module to transform Pandas.Dataframe to parquet file through the pyarrow engine."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The httpx module that allows to post request to the Wellbore DDMS."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Prerequisite to run this notebook\n!python -m pip install pip --upgrade\n!pip install pandas numpy httpx pyarrow\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authorization","__idx":3},"children":["Authorization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For any call to Wellbore DDMS API's you need to pass into the header of the request a valid bearer token. This token can be obtained from any API catalog on the developer portal. You will need first to request a developer base subscription. Then from the developer base subscription pick any API and execute it. A valid bearer token is returns in the Curl section of the response. Copy this token value and assign it to the TOKEN variable below."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"TOKEN = '' # Paste here the token without the bearer prefix\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"utility-methods","__idx":4},"children":["Utility methods"]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":[" Helper functions used in the different sample scripts of this tutorial. "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from typing import List\nimport httpx\nimport pandas as pd\nimport numpy as np\nimport io\nfrom IPython.display import display_html, display, HTML\nfrom itertools import chain, cycle\n\ndef generate_df_typed(columns, index):\n    def gen_values(col_name, size):\n        if col_name.startswith('float'):\n            return np.random.random_sample(size=size)\n        if col_name.startswith('str'):\n            return [f'string_value_{i}' for i in range(size)]\n        if col_name.startswith('bool'):\n            return np.random.choice(a=[False, True], size=size) \n        if col_name.startswith('date'):\n            return (np.datetime4('2021-01-01') + days for days in range(size))\n        return np.random.randint(-100, 1000, size=size)\n\n    df = pd.DataFrame({c: gen_values(c, len(index))\n                      for c in columns}, index=index)\n    return df\n\ndef multi_table(table_list):\n    '''Acceps a list of IpyTable objects and returns a table which contains each IpyTable in a cell'''\n    return HTML(\n        '<table><tr style=\"background-color:white;\">' + \n        ''.join(['<td>' + table._repr_html_() + '</td>' for table in table_list]) +\n        '</tr></table>'\n    )\n\ndef gen_color(color):\n    def fct(val=None):\n         return f'color: {color}'\n    return fct\n\ndef display_operation(before, sent, after):\n    colors = ['blue', 'green', 'orange', 'red']\n    color_fct = [gen_color(c) for c in colors]\n    sent_st = [sent[i].style.set_caption(f'chunk {i+1} sent').applymap(color_fct[i]) for i in range(len(sent))]\n    def color_output(s):\n        res = []\n        for r in s.index:\n            c = ''\n            for i in range(len(sent)):\n                if s.name in sent[i] and int(r) in sent[i][s.name]:\n                    c = color_fct[i]()#f'color: {colors[i]}'\n            res.append(c)\n        return res\n\n    margin = '65'\n    after_st = after.style.set_table_attributes(f\"style='margin-left:{margin}px'\").apply(color_output).highlight_null(null_color='lightyellow').set_caption('Final data - After session commit')   \n    display(multi_table([before.style.set_table_attributes(f\"style='margin-right:{margin}px'\").set_caption('Initial data - Before session'), *sent_st, after_st]))\n    \ndef display_side_by_side(dfs:list, captions:list):\n    \"\"\"Display tables side by side to save vertical space\n    Input:\n        dfs: list of pandas.DataFrame\n        captions: list of table captions\n    \"\"\"\n    output = \"\"\n    combined = dict(zip(captions, dfs))\n    for caption, df in combined.items():\n        output += df.style.set_table_attributes(\"style='display:inline'\").set_caption(caption)._repr_html_()\n        output += \"\\xa0\\xa0\\xa0\"\n    display(HTML(output))\n    \ndef generate_df(columns: List[str], index):\n    nbrows = len(index)\n    df = pd.DataFrame(\n        np.random.randint(-100, 1000, size=(nbrows, len(columns))), index=index)\n    df.columns= columns\n    return df\n\n\ndef print_response(resp):\n    print(f'{resp.request.method} : {resp.url} -> {resp.status_code}')\n    if resp.status_code != httpx.codes.OK:\n        display(resp.content)\n\n        \ndef create_df_from_response(response):\n    \"\"\"Returns a dataframe created from the WellLog bulk data response\n    Input:\n        response: a httpx.response object\n    Output:\n        dataframe: a pandas.dataframe object\n    \"\"\"\n    content_type = response.headers.get('content-type')\n    \n    if content_type == 'application/json':\n        return pd.DataFrame.from_dict(response.json())\n    \n    elif content_type == 'application/x-parquet':\n        f = io.BytesIO(response.content)\n        f.seek(0)\n        return pd.read_parquet(f)\n    \n    raise ValueError(f\"Unknown content-type: '{content_type}'\")\n    \ndef display_previous_and_current_well_log_data_versions(record_id):\n    \"\"\"Display the previous and current WellLog data versions for a given record id and highlight differences between them.\n    Input:\n        record_id: a WellLog record id\n    \"\"\"\n    # list record version\n    results_response = client.get(f'{welllog_dms_url}/{record_id}/versions')\n    wellLog_versions_response = results_response.json()\n    versions = wellLog_versions_response['versions']\n    \n    is_previous_results = False\n    is_current_results = False\n    if len(versions) >= 2:\n        previous_version_id = versions[len(versions)-2]\n        curl = f'{welllog_dms_url}/{record_id}/versions/{previous_version_id}/data'\n        results_response = client.get(curl)\n        if results_response.status_code == 200:\n            previous_results = create_df_from_response(results_response)\n            is_previous_results = True\n    \n        current_version_id = versions[len(versions)-1]\n        curl = f'{welllog_dms_url}/{record_id}/versions/{current_version_id}/data'\n        results_response = client.get(curl)\n        if results_response.status_code == 200:\n            current_results = create_df_from_response(results_response)\n            is_current_results = True\n    \n    colors = ['blue', 'red']\n    color_fct = [gen_color(c) for c in colors]\n    def color_output(s):\n        res = []        \n        for r in s.index:\n            c = ''\n            if s.name in previous_results and int(r) in previous_results[s.name]:\n                c = color_fct[0]()\n            else:\n                c = color_fct[1]()\n            res.append(c)\n        return res\n    \n    margin = '65'\n    tables = []\n    if is_previous_results:\n        previous_results_st = previous_results.style.set_table_attributes(f\"style='margin-left:{margin}px'\").highlight_null(null_color='lightyellow').set_caption('Previous WellLog data version').applymap(color_fct[0])  \n        tables.append(previous_results_st)\n        \n    if is_current_results:\n        if is_previous_results:\n            current_results_st = current_results.style.set_table_attributes(f\"style='margin-left:{margin}px'\").apply(color_output).highlight_null(null_color='lightyellow').set_caption('Current WellLog data version with data chunks added in red')\n            tables.append(current_results_st)\n        else:\n            current_results_st = current_results.style.set_table_attributes(f\"style='margin-left:{margin}px'\").highlight_null(null_color='lightyellow').set_caption('Current WellLog data version') \n            tables.append(current_results_st)\n        \n    display(multi_table(tables))\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"settings","__idx":5},"children":["Settings"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Several settings as the base url end-point and the data partition id to create a WellLog to the Wellbore DDMS. Please change those settings accordingly to the environment settings that you want to target."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"base_url = \"\" # set a base URL value\ndata_partition_id = \"\" # set a data partition id\nlegal_tag = \"\" # set a valid legal tag in the data partition \nacl_domain = \"\" # set an Access Control Lists (ACL) domain\n\nwelllog_dms_url = f'{base_url}/api/os-wellbore-ddms/ddms/v3/welllogs'\n\nclient = httpx.Client(verify=False,\n    headers={\n        \"data-partition-id\": f\"{data_partition_id}\",\n        \"Authorization\": f\"Bearer {TOKEN}\",\n    },\n    timeout=120\n)\n\n# Create a new WellLog. Here is a fake body just to illustrate the API use\nrecord = {\n    \"kind\": \"osdu:wks:work-product-component--WellLog:1.0.0\",\n    \"acl\": {\n        \"viewers\": [f\"data.default.viewers@{data_partition_id}.{acl_domain}\"],\n        \"owners\": [f\"data.default.owners@{data_partition_id}.{acl_domain}\"]\n      },\n    \"legal\": {\n        \"legaltags\": [f\"{legal_tag}\"],\n        \"otherRelevantDataCountries\": [\"US\"],\n    },\n    \"data\": {\"\"\n        \"WellboreID\": \"namespace:master-data--Wellbore:SomeUniqueWellboreID:\",\n        \"Curves\": [\n            {\n                \"CurveID\": \"MD\",\n                \"NumberOfColumns\": 1\n            },\n            {\n                \"CurveID\": \"X\",\n                \"NumberOfColumns\": 1\n            }\n        ]\n    },\n}\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-welllog-record","__idx":6},"children":["Create a WellLog record"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The script below is creating a WellLog record that is used in this tutorial to demonstrate how to write WellLog bulk data to the Wellbore DDMS."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"response = client.post(welllog_dms_url, json=[record])\nprint_response(response)\nrecord_id = response.json()[\"recordIds\"][0]\nrecord_id\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"2-how-to-trigger-welllog-bulk-data-statistics-computation","__idx":7},"children":["2. How to trigger WellLog bulk data statistics computation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Current limitations to manually trigger the WellLog bulk data statistics computation are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In case of error, a delay of 1h before triggering the computation again for the same WellLog data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A maximum of 3 attempts to compute statistics for a given WellLog data is allowed."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-welllog-record","__idx":8},"children":["Create WellLog record"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"record = {\n    \"kind\": f\"{data_partition}:wks:work-product-component--WellLog:1.0.0\",\n    \"acl\": {\n        \"viewers\": [f\"data.default.viewers@{data_partition}.{acl_domain}\"],\n        \"owners\": [f\"data.default.owners@{data_partition}.{acl_domain}\"]\n      },\n    \"legal\": {\n        \"legaltags\": [legal_tag],\n        \"otherRelevantDataCountries\": [\"US\"],\n    },\n    \"data\": {\n        \"Curves\": [\n            {\"CurveID\": 'int-A'},\n            {\"CurveID\": 'int-A-with-nan'},\n            {\"CurveID\": 'float-B'},\n            {\"CurveID\": 'float-B-with-nan'}, \n            {\"CurveID\": 'date-C'}, \n            {\"CurveID\": 'date-C-with-nan'},\n            {\"CurveID\": 'bool-D'},\n            {\"CurveID\": 'string-E'},\n        ]\n    },\n}\n\nresponse_typed = client.post(welllog_url, json=[record])\nprint_response(response_typed)\ntypes_col_record_id = response_typed.json()[\"recordIds\"][0]\nprint(types_col_record_id)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["POST : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs -> 200"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"post-welllog-data","__idx":9},"children":["POST WellLog data"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"columns = ['int-A', 'int-A-with-nan', 'float-B', 'float-B-with-nan', 'bool-D', 'string-E', 'date-C', 'date-C-with-nan']\n\ndifferent_type_df = generate_df_typed(columns, range(100_000))\nadd_nan_values_to_df(different_type_df)\ndisplay(different_type_df)\n\ndata_to_send = different_type_df.to_parquet(engine='pyarrow')\n\nwrite_response = client.post(f'{welllog_url}/{types_col_record_id}/data', data=data_to_send, headers={'content-type': 'application/parquet'})\nprint_response(write_response)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"int-A"},"children":["int-A"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"int-A-with-nan"},"children":["int-A-with-nan"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"float-B"},"children":["float-B"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"float-B-with-nan"},"children":["float-B-with-nan"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"bool-D"},"children":["bool-D"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"string-E"},"children":["string-E"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"date-C"},"children":["date-C"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"date-C-with-nan"},"children":["date-C-with-nan"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["868"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["592.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.792575"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.113692"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.000"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["222"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["624.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.529602"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.047647"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.001"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaT"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["842"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["359.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.184516"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.783715"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_2"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.002"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaT"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["879"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["280.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.526019"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.288487"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_3"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.003"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaT"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["4"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["456"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["619.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.512207"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.373447"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_4"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.004"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00.004"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["..."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["..."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["99995"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["560"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["220.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.714021"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.064975"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_99995"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.995"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.995"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["99996"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["861"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["78.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.663497"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.560253"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_99996"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.996"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.996"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["99997"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["916"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.687259"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaN"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_99997"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.997"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.997"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["99998"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["354"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["933.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.563194"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.921421"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_99998"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.998"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.998"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["99999"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["-14"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["812.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.976996"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.644540"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string_value_99999"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.999"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaT"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note: NaT means Not a Time, equivalent of NaN for dates."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["POST : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9/data -> 200"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"trigger-bulk-statistics-computation","__idx":10},"children":["Trigger bulk statistics computation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Computation can be manually triggered if WellLog was created before M12 release or in case of computation error."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API to use:"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /ddms/v3/welllogs/{record_id}/versions/{version}/data/statistics"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["NOTE: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["record version"]}," are required."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"welllog_meta_response = client.get(f'{welllog_url}/{record_id}')\nprint_response(welllog_meta_response)\nrecord_version = welllog_meta_response.json()['version']\n\npost_welllog_stats_response = client.post(f'{welllog_url}/{record_id}/versions/{record_version}/data/statistics', headers={'content-type': 'application/parquet'})\nprint_response(post_welllog_stats_response)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["GET : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:89bd0debbcf1411fb240d0a906da7cd4 -> 200"," ","POST : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:89bd0debbcf1411fb240d0a906da7cd4/versions/1653990573032433/data/statistics -> 200"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"3-how-to-fetch-welllog-bulk-data-statistics-already-computed","__idx":11},"children":["3. How to fetch WellLog bulk data statistics already computed"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Please, note that WellLog's curves with string and boolean data types are not computed"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-statistics-data-as-json","__idx":12},"children":["Display statistics data as JSON"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Leave the parameter \"curves\" empty will select all the WellLog's curves statistics available\nselect_all_curves_param = {}\n\n # To select only curves: 'int-A', 'float-B' and 'date-C' from computed statistics\nselect_specific_curves_params = {\"curves\": \"int-A,float-B,date-C\"}\n\n%time post_welllog_stats_response = client.get(f'{welllog_url}/{types_col_record_id}/data/statistics', param=select_all_curves_param)\nprint_response(post_welllog_stats_response)\n\njson_posted_stats = post_welllog_stats_response.json()\ndisplay(json_posted_stats)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CPU times: total: 141 ms"," ","Wall time: 2.01 s"," ","GET : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9/data/statistics -> 200"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'computationStartDatetime': '2022-05-31T09:17:08.431223',"," ","'recordId': 'osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9',"," ","'recordVersion': 1653988624188709,"," ","'computationStatus': 'complete',"," ","'data': {'int-A-with-nan': {'mean': '449.8925764705882',"," ","'std': '317.8241340241287',"," ","'min': '-100.0',"," ","'10%': '10.0',"," ","'50%': '450.0',"," ","'90%': '890.0',"," ","'max': '999.0',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '85000.0'},"," ","'int-A': {'mean': '449.63618',"," ","'std': '317.49388998642064',"," ","'min': '-100.0',"," ","'10%': '9.0',"," ","'50%': '451.0',"," ","'90%': '890.0',"," ","'max': '999.0',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '100000.0'},"," ","'date-C': {'mean': '2021-01-01 00:00:49.999499776',"," ","'std': 'NaN',"," ","'min': '2021-01-01 00:00:00',"," ","'10%': '2021-01-01 00:00:09.999899904',"," ","'50%': '2021-01-01 00:00:49.999500032',"," ","'90%': '2021-01-01 00:01:29.999100160',"," ","'max': '2021-01-01 00:01:39.999000',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '100000'},"," ","'date-C-with-nan': {'mean': '2021-01-01 00:00:49.995083776',"," ","'std': 'NaN',"," ","'min': '2021-01-01 00:00:00',"," ","'10%': '2021-01-01 00:00:10.055899904',"," ","'50%': '2021-01-01 00:00:49.966500096',"," ","'90%': '2021-01-01 00:01:29.970099968',"," ","'max': '2021-01-01 00:01:39.998000',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '85000'},"," ","'float-B-with-nan': {'mean': '0.4981784333593075',"," ","'std': '0.2888887958106551',"," ","'min': '3.56818820279603e-06',"," ","'10%': '0.09984358734025209',"," ","'50%': '0.4974533393916296',"," ","'90%': '0.8997088186446737',"," ","'max': '0.9999888136429178',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '85000.0'},"," ","'float-B': {'mean': '0.4980908954221541',"," ","'std': '0.2885563043838143',"," ","'min': '1.4538739944169876e-06',"," ","'10%': '0.09894710442338889',"," ","'50%': '0.4969224934210345',"," ","'90%': '0.8987151676695218',"," ","'max': '0.9999918891377975',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '100000.0'}}}"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-statistics-data-in-a-dataframe","__idx":13},"children":["Display statistics data in a Dataframe"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"json_posted_stats_copy = response_copy_without_data(post_welllog_stats_response)\ndisplay(json_posted_stats_copy)\n\ncreate_df_from_dict(post_welllog_stats_response)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'computationStartDatetime': '2022-05-31T09:17:08.431223',"," ","'recordId': 'osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9',"," ","'recordVersion': 1653988624188709,"," ","'computationStatus': 'complete'}"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"mean"},"children":["mean"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"std"},"children":["std"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"min"},"children":["min"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"10%"},"children":["10%"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"50%"},"children":["50%"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"90%"},"children":["90%"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"max"},"children":["max"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"totalCount"},"children":["totalCount"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"nonAbsentValuesCount"},"children":["nonAbsentValuesCount"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["int-A-with-nan"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["449.8925764705882"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["317.8241340241287"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["-100.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["10.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["450.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["890.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["999.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["85000.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["date-C"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:49.999499776"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaN"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:09.999899904"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:49.999500032"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:29.999100160"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.999000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["float-B-with-nan"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4981784333593075"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.2888887958106551"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3.56818820279603e-06"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.09984358734025209"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4974533393916296"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.8997088186446737"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.9999888136429178"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["85000.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["float-B"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4980908954221541"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.2885563043838143"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1.4538739944169876e-06"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.09894710442338889"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.4969224934210345"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.8987151676695218"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.9999918891377975"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["int-A"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["449.63618"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["317.49388998642064"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["-100.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["9.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["451.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["890.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["999.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["date-C-with-nan"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:49.995083776"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["NaN"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:00"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:10.055899904"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:00:49.966500096"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:29.970099968"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2021-01-01 00:01:39.998000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["85000"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"4-fetch-welllog-bulk-statistics-code-examples","__idx":14},"children":["4. Fetch WellLog bulk statistics code examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIs:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{record_id}/data/statistics"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{record_id}/versions/{version}/data/statistics"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"select-specifics-curves-statistics","__idx":15},"children":["Select specifics curves statistics"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["As the GET bulk API, you can fetch statistics only for specifics curves"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fetch-welllog-bulk-information-and-retrieve-columns-from-it","__idx":16},"children":["Fetch WellLog bulk information and retrieve columns from it"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{record_id}/data?describe=True"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"welllog_bulk_response_example_1 = client.get(f'{welllog_url}/{types_col_record_id}/data', params={'describe':True})\nrecord_columns = welllog_bulk_response_example_1.json().get('columns', [])\ndisplay(welllog_bulk_response_example_1.json())\n\nwanted_curves = [c for c in record_columns if c.startswith('float')]\nprint(\"\\nWanted WellLog's curves\", wanted_curves)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'numberOfRows': 100000,"," ","'columns': ['bool-D',"," ","'date-C',"," ","'date-C-with-nan',"," ","'float-B',"," ","'float-B-with-nan',"," ","'int-A',"," ","'int-A-with-nan',"," ","'string-E']}"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wanted WellLog's curves ['float-B', 'float-B-with-nan']"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fetch-welllog-bulk-statistics-of-selected-welllogs-curves","__idx":17},"children":["Fetch WellLog bulk statistics of selected WellLog's curves"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{record_id}/data/statistics"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Generate list of wanted curves from previous describe=True API.\nwanted_curves_params = {\n    'curves': ','.join(wanted_curves)\n}\n\nwelllog_stats_response_example_1 = client.get(f'{welllog_url}/{types_col_record_id}/data/statistics', params=wanted_curves_params)\nprint_response(welllog_stats_response_example_1)\n\njson_posted_stats_example_1 = welllog_stats_response_example_1.json()\ndisplay(json_posted_stats_example_1)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'curves': 'float-B,float-B-with-nan'}"," ","GET : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9/data/statistics?curves=float-B%2Cfloat-B-with-nan -> 200"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'computationStartDatetime': '2022-05-31T09:17:08.431223',"," ","'recordId': 'osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9',"," ","'recordVersion': 1653988624188709,"," ","'computationStatus': 'complete',"," ","'data': {'float-B': {'mean': '0.4980908954221541',"," ","'std': '0.2885563043838143',"," ","'min': '1.4538739944169876e-06',"," ","'10%': '0.09894710442338889',"," ","'50%': '0.4969224934210345',"," ","'90%': '0.8987151676695218',"," ","'max': '0.9999918891377975',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '100000.0'},"," ","'float-B-with-nan': {'mean': '0.4981784333593075',"," ","'std': '0.2888887958106551',"," ","'min': '3.56818820279603e-06',"," ","'10%': '0.09984358734025209',"," ","'50%': '0.4974533393916296',"," ","'90%': '0.8997088186446737',"," ","'max': '0.9999888136429178',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '85000.0'}}}"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fetch-welllog-bulk-statistics-of-anterior-welllog-bulk-version","__idx":18},"children":["Fetch WellLog bulk statistics of anterior WellLog bulk version"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"list-welllog-anterior-versions","__idx":19},"children":["List WellLog anterior versions"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{welllogId}/versions"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"welllog_record_response_example_2 = client.get(f'{welllog_url}/{types_col_record_id}/versions')\nrecord_versions = welllog_record_response_example_2.json().get('versions', [])\n\nprint(\"record_versions:\", record_versions)\nlast_record_version = record_versions[-1]\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["record_versions: [1653988602340449, 1653988624188709]"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"then-fetch-welllog-bulk-statistics-at-specified-version","__idx":20},"children":["Then, fetch WellLog bulk statistics at specified version"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GET /ddms/v3/welllogs/{record_id}/versions/{version}/data/statistics"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"wanted_curves_params = {\n    'curves': ','.join(wanted_curves)\n}\n\nrecord_version = last_record_version\n\nwelllog_stats_response_example_2 = client.get(f'{welllog_url}/{types_col_record_id}/versions/{record_version}/data/statistics', params=wanted_curves_params)\nprint_response(welllog_stats_response_example_2)\n\njson_posted_stats_example_2 = welllog_stats_response_example_2.json()\ndisplay(json_posted_stats_example_2)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["GET : https://<ENVIRONMENT_BASE_URL>/api/os-wellbore-ddms/ddms/v3/welllogs/osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9/versions/1653988624188709/data/statistics?curves=float-B%2Cfloat-B-with-nan -> 200"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{'computationStartDatetime': '2022-05-31T09:17:08.431223',"," ","'recordId': 'osdu:work-product-component--WellLog:ac6ec4b8074941b19c4723b1dbdc0da9',"," ","'recordVersion': 1653988624188709,"," ","'computationStatus': 'complete',"," ","'data': {'float-B': {'mean': '0.4980908954221541',"," ","'std': '0.2885563043838143',"," ","'min': '1.4538739944169876e-06',"," ","'10%': '0.09894710442338889',"," ","'50%': '0.4969224934210345',"," ","'90%': '0.8987151676695218',"," ","'max': '0.9999918891377975',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '100000.0'},"," ","'float-B-with-nan': {'mean': '0.4981784333593075',"," ","'std': '0.2888887958106551',"," ","'min': '3.56818820279603e-06',"," ","'10%': '0.09984358734025209',"," ","'50%': '0.4974533393916296',"," ","'90%': '0.8997088186446737',"," ","'max': '0.9999888136429178',"," ","'totalCount': '100000',"," ","'nonAbsentValuesCount': '85000.0'}}}"]}]},"headings":[{"value":"Introduction","id":"introduction","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":1},{"value":"Required Python packages","id":"required-python-packages","depth":2},{"value":"Authorization","id":"authorization","depth":2},{"value":"Utility methods","id":"utility-methods","depth":2},{"value":"Settings","id":"settings","depth":2},{"value":"Create a WellLog record","id":"create-a-welllog-record","depth":2},{"value":"2. How to trigger WellLog bulk data statistics computation","id":"2-how-to-trigger-welllog-bulk-data-statistics-computation","depth":1},{"value":"Create WellLog record","id":"create-welllog-record","depth":2},{"value":"POST WellLog data","id":"post-welllog-data","depth":2},{"value":"Trigger bulk statistics computation","id":"trigger-bulk-statistics-computation","depth":2},{"value":"3. How to fetch WellLog bulk data statistics already computed","id":"3-how-to-fetch-welllog-bulk-data-statistics-already-computed","depth":1},{"value":"Display statistics data as JSON","id":"display-statistics-data-as-json","depth":3},{"value":"Display statistics data in a Dataframe","id":"display-statistics-data-in-a-dataframe","depth":3},{"value":"4. Fetch WellLog bulk statistics code examples","id":"4-fetch-welllog-bulk-statistics-code-examples","depth":1},{"value":"Select specifics curves statistics","id":"select-specifics-curves-statistics","depth":2},{"value":"Fetch WellLog bulk information and retrieve columns from it","id":"fetch-welllog-bulk-information-and-retrieve-columns-from-it","depth":3},{"value":"Fetch WellLog bulk statistics of selected WellLog's curves","id":"fetch-welllog-bulk-statistics-of-selected-welllogs-curves","depth":3},{"value":"Fetch WellLog bulk statistics of anterior WellLog bulk version","id":"fetch-welllog-bulk-statistics-of-anterior-welllog-bulk-version","depth":3},{"value":"List WellLog anterior versions","id":"list-welllog-anterior-versions","depth":4},{"value":"Then, fetch WellLog bulk statistics at specified version","id":"then-fetch-welllog-bulk-statistics-at-specified-version","depth":4}],"frontmatter":{"seo":{"title":"Introduction"}},"lastModified":"2025-04-09T17:56:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/wellbore-dms/tutorial/osdu-wdms-bulk-statistics","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}