{"id":18392888,"url":"https://github.com/drklrd/pystats","last_synced_at":"2025-09-21T21:14:45.967Z","repository":{"id":88247929,"uuid":"105775572","full_name":"drklrd/pystats","owner":"drklrd","description":"Statistics using python.","archived":false,"fork":false,"pushed_at":"2017-10-04T14:03:33.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T01:31:37.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drklrd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-04T14:02:57.000Z","updated_at":"2017-10-04T14:03:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"616a43bd-0e2b-44b6-84dc-d7f99c01f5fc","html_url":"https://github.com/drklrd/pystats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drklrd%2Fpystats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drklrd%2Fpystats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drklrd%2Fpystats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drklrd%2Fpystats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drklrd","download_url":"https://codeload.github.com/drklrd/pystats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248559174,"owners_count":21124428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:58:25.961Z","updated_at":"2025-09-21T21:14:45.897Z","avatar_url":"https://github.com/drklrd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Major types of data\n\n- Numerical\n\t- Quantitative measurement\n\t- Discreate, Continuos\n\n- Categorical\n\t- Qualitative data with no inherent mathematical meaning\n\t- Gender, Yes/no\n\n- Ordinal\n\t- Mixture of numerical and categorical\n\t- Rating of a movie\n\n## Mean, Median and Mode\n\n```\nMean : Average\n\n0,2,3,2,1,0,0,2,0\n\nMean = (0+2+3+2+1+0+0+2+0) / 9 = 1.11\n\n```\n\n```\nSort the values and take the value at midpoint\n\n0,2,3,2,1,0,0,2,0\n\nSort it :\n\n0,0,0,0,1,2,2,2,3\n        *\n\n```\n\nMedian is less susceptible to outliers than mean\n\nEg: Mean houseold income in US is $72,641 but the median is $52,939 as the mean is skewed by some billionaires\n\nMedian better represents the typical American in this example\n\n\n```\nMode : The most common value in data set\nNot relevant to continuous numerical data\n```\n\n## Standard deviation, Variance\n\nMeasures how \"spread-out\" the data is.\n\nVariance is simply the average of the squared differences from the mean.\n\nStandard deviation is just the square root of the variance. This is usually a way to identify outliers. Data points that lie more than one standard deviation from the mean can be considered unusual. We can talk about how extreme a data point is by talking about \"how many sigmas\" away from the mean it is.\n\n\n## Population variance vs Sample variance\n\nFor N samples, we just divide the squared variances by N-1 instead of N.\n\n\n\n## Probability density functions(Continuous data)\n\nExample - A normal distribution\n\nGives the probability of a data point falling within some given range of a given value\n\n\n## Probability mass functions(discrete data)\n\nFor discrete data.\n\n\n\n## Examples of Data distributions\n\n### Uniform distribution\n\nFlat constast probability of a value occuring within a given range. Unlike normal distribution where the concentration is around the mean, the uniform distribution has equal probality across any given value within the range we define\n\n### Normal/Gaussian\n\n### Exponential PDF / \"Power Law\"\n\n### Binomial probability mass function(discrete data)\n\n### Poisson probability mass function(discrete data)\n\nA website has an average 500 visits per day. Whats the odds of getting 550 ?\n\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nvalues = np.random.uniform(-10.0,10.0,100000)\nplt.hist(values,50)\nplt.show()\n\n\n# Normal/Gaussian distribution\n\nfrom scipy.stats import norm\nimport matplotlib.pyplot as plt\n\nx= np.arange(-3,3,0.001)\nplt.plot(x,norm.pdf(x))\nplt.show()\n\n#Poisson Probability mass function\n\nfrom scipy.stats import poisson\nimport matplotlib.pyplot as plt\n\nmu = 500\nx = np.arange(400,600,0.5)\nplt.plot(x,poisson.pmf(x,mu))\nplt.show()\n\n```\n\n\n# Percentiles and Moments\n\nPercentile : For a dataset, whats the point at which X% of the values are less than that value\n\nMements : Ways to measure shape of data distribution(probability distribution function)\n\nThe first moment is the mean.\nThe second moment is the variance.\nThe third moment is \"skew\" - measure of how lopsided the distribution(Positive , Negative)\nThr fourth moment is the 'kurtosis' - how thick is the tail and how sharp is the peak. Higher peaks =\u003e higher kurtosis\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrklrd%2Fpystats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrklrd%2Fpystats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrklrd%2Fpystats/lists"}