Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Bioinformatics with Python Cookbook
  • Toc
  • feedback
Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

By : Tiago R Antao, Tiago Antao
4.7 (6)
close
Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

4.7 (6)
By: Tiago R Antao, Tiago Antao

Overview of this book

If you have intermediate-level knowledge of Python and are well aware of the main research and vocabulary in your bioinformatics topic of interest, this book will help you develop your knowledge further.
Table of Contents (11 chapters)
close
10
Index

Computing the median in a large dataset


As you have seen in the first recipe, computing the median requires having all the values available. With something like a mean, we just need an accumulator and a counter. The fundamental point of this recipe is to introduce the idea of approximate computing; with big data, it may not always be the best strategy to get the precise value (of course, this should be evaluated on a case-by-case basis).

Getting ready

We will require the first recipe to have been fully run.

Here, we will take two different strategies to compute the median: approximating the data points in a way that allows compression of data and subsampling of data.

As usual, this is available in the 08_Advanced/Median.ipynb notebook.

How to do it...

Take a look at the following steps:

  1. Our first approach will be to use approximations of all values, starting with creating a dictionary. This code should be run where the first recipe was run:

    from __future__ import division, print_function
    import...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete