{"id":3869,"date":"2024-03-27T11:55:29","date_gmt":"2024-03-27T11:55:29","guid":{"rendered":"http:\/\/van-maanen.com\/?p=3869"},"modified":"2024-03-27T11:55:29","modified_gmt":"2024-03-27T11:55:29","slug":"univariate-descriptive-statistics-in-python","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=3869","title":{"rendered":"Univariate descriptive statistics in python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, a programme is given on the univariate statistics. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd\nimport sqlalchemy as sa\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ntable_name = 'MIGRATED_DIVORCE_SETTLEMENT__C'\n\nconnection_string = \"DRIVER={ODBC Driver 17 for SQL Server};SERVER=DESKTOP-8J58OIP\\MSSQLSERVER_19;DATABASE=Speel;UID=sa;PWD=AAaa11!!\"\nconnection_url = sa.engine.URL.create(\"mssql+pyodbc\", query={\"odbc_connect\": connection_string})\nengine = sa.engine.create_engine(connection_url)\nwith engine.begin() as conn:\n    df = pd.read_sql_query(sa.text(\"SELECT * FROM Rapportage.\" + table_name), conn)\n\nonderzoek = df[['Person_ID_1__c','Person_ID_2__c']].apply(pd.to_numeric).dropna()\nprint(onderzoek.info())\nprint(onderzoek.head())\n\nprint(onderzoek.describe())\n\nonderzoek.boxplot(column=['Person_ID_1__c','Person_ID_2__c'], grid = False)\n\nprint('**********programma beindigd****')\n\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"http:\/\/van-maanen.com\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-27-125445.png\" alt=\"\" class=\"wp-image-3870\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Below, a programme is given on the univariate statistics. import pandas as pd import sqlalchemy as sa import matplotlib.pyplot as plt import numpy as np table_name = &#8216;MIGRATED_DIVORCE_SETTLEMENT__C&#8217; connection_string = &#8220;DRIVER={ODBC Driver 17 for SQL Server};SERVER=DESKTOP-8J58OIP\\MSSQLSERVER_19;DATABASE=Speel;UID=sa;PWD=AAaa11!!&#8221; connection_url = sa.engine.URL.create(&#8220;mssql+pyodbc&#8221;, query={&#8220;odbc_connect&#8221;: connection_string}) engine = sa.engine.create_engine(connection_url) with engine.begin() as conn: df = pd.read_sql_query(sa.text(&#8220;SELECT * FROM Rapportage.&#8221; + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-3869","post","type-post","status-publish","format-standard","hentry","category-niet-gecategoriseerd"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/3869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3869"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/3869\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3869"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}