From 7e8e6451159b5386b8f55f23db54e35238061522 Mon Sep 17 00:00:00 2001 From: redoules Date: Thu, 8 Nov 2018 23:41:12 +0100 Subject: [PATCH] added an article stat challenge day 1 --- blog/Statistics_10days-day0.html | 7 +- blog/Statistics_10days-day1.html | 268 ++++++++++++++++++ .../Installing_bitcoind_on_raspberry_pi.html | 2 +- cryptocurrencies/blockchain_bad.html | 2 +- images/stat_challenge/day1/ecart_type.png | Bin 0 -> 5762 bytes images/stat_challenge/day1/moyenne.png | Bin 0 -> 9782 bytes index.html | 3 +- jupyter/clear_cell.html | 2 +- jupyter/remote_run_notebook.html | 2 +- linux/Reloading_.bashrc.html | 2 +- linux/Reloading_fstab.html | 2 +- linux/bashrc.html | 2 +- linux/directory_size.html | 2 +- linux/free_disk_space_linux.html | 2 +- linux/get_ip_linux.html | 2 +- linux/linux_process_information.html | 2 +- linux/mount_nfs_share_fstab.html | 2 +- linux/share_nfs_share.html | 2 +- linux/simple_bash_function.html | 2 +- linux/version_kernel.html | 2 +- ...he recommandation engine for articles.html | 2 +- mathematics/Number_edges_Complete_graph.html | 2 +- pages/about.html | 2 +- python/Creating_a_sqlite_database.html | 2 +- ...of_eigenvalues_from_a_list_of_tensors.html | 2 +- python/Iterating_over_a_dataframe.html | 2 +- python/Moving_average_pandas.html | 2 +- python/Opening_SQLite_database.html | 2 +- python/Opening_file.html | 2 +- python/Optimized_numpy_random_intel.html | 2 +- ..._data_from_a_sql_database_with_pandas.html | 2 +- ...plotlib_figure_with_a_high_resolution.html | 2 +- ...notebook_for_plotting_with_matplotlib.html | 2 +- ...ng_data_to_a_sql_database_with_pandas.html | 2 +- python/counting.html | 2 +- python/dask_distributed_parallelism.html | 2 +- python/dask_infiniband.html | 2 +- python/design_own_libs.html | 2 +- python/dict_comprehension.html | 2 +- python/download_page.html | 2 +- python/ensure_dir.html | 2 +- python/list_files_directory.html | 2 +- python/logplot.html | 2 +- python/reverse.html | 2 +- python/sorting.html | 2 +- python/stock_pandas.html | 2 +- python/unique.html | 2 +- ...ting_all_python_package_with_anaconda.html | 2 +- search.html | 2 +- sitemap.xml | 9 +- sql/Sorting_results.html | 2 +- sql/WHERE_SQL_keywords.html | 2 +- sql/display_table.html | 2 +- sql/display_table_filter.html | 2 +- tipuesearch_content.json | 2 +- 55 files changed, 332 insertions(+), 53 deletions(-) create mode 100644 blog/Statistics_10days-day1.html create mode 100644 images/stat_challenge/day1/ecart_type.png create mode 100644 images/stat_challenge/day1/moyenne.png diff --git a/blog/Statistics_10days-day0.html b/blog/Statistics_10days-day0.html index 1839b75..9262c48 100644 --- a/blog/Statistics_10days-day0.html +++ b/blog/Statistics_10days-day0.html @@ -136,7 +136,10 @@ For a continuous probability distribution, the median is the value such that a n

Implementation in python without using the scientific libraries

def median(l):
     l = sorted(l)
-    return (l[len(l) // 2] + l[(len(l)//2 - 1)]) / 2
+    if len(l) % 2 == 0:
+        return (l[len(l) // 2] + l[(len(l)//2 - 1)]) / 2
+    else:
+        return l[len(l)//2]
 
 def mean(l):
     return sum(l)/len(l)
@@ -182,7 +185,7 @@ Mean : 43117.75, Median : 44627.5, Mode : 4978