{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# EventVestor: Clinical Trials\n", "\n", "In this notebook, we'll take a look at EventVestor's *Clinical Trials* dataset, available on the [Quantopian Store](https://www.quantopian.com/store). This dataset spans January 01, 2007 through the current day, and documents announcements of key phases of clinical trials by biotech/pharmaceutical companies.\n", "\n", "### Blaze\n", "Before we dig into the data, we want to tell you about how you generally access Quantopian Store data sets. These datasets are available through an API service known as [Blaze](http://blaze.pydata.org). Blaze provides the Quantopian user with a convenient interface to access very large datasets.\n", "\n", "Blaze provides an important function for accessing these datasets. Some of these sets are many millions of records. Bringing that data directly into Quantopian Research directly just is not viable. So Blaze allows us to provide a simple querying interface and shift the burden over to the server side.\n", "\n", "It is common to use Blaze to reduce your dataset in size, convert it over to Pandas and then to use Pandas for further computation, manipulation and visualization.\n", "\n", "Helpful links:\n", "* [Query building for Blaze](http://blaze.pydata.org/en/latest/queries.html)\n", "* [Pandas-to-Blaze dictionary](http://blaze.pydata.org/en/latest/rosetta-pandas.html)\n", "* [SQL-to-Blaze dictionary](http://blaze.pydata.org/en/latest/rosetta-sql.html).\n", "\n", "Once you've limited the size of your Blaze object, you can convert it to a Pandas DataFrames using:\n", "> `from odo import odo` \n", "> `odo(expr, pandas.DataFrame)`\n", "\n", "### Free samples and limits\n", "One other key caveat: we limit the number of results returned from any given expression to 10,000 to protect against runaway memory usage. To be clear, you have access to all the data server side. We are limiting the size of the responses back from Blaze.\n", "\n", "There is a *free* version of this dataset as well as a paid one. The free one includes about three years of historical data, though not up to the current day.\n", "\n", "With preamble in place, let's get started:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# import the dataset\n", "from quantopian.interactive.data.eventvestor import clinical_trials\n", "# or if you want to import the free dataset, use:\n", "# from quantopian.data.eventvestor import clinical_trials_free\n", "\n", "# import data operations\n", "from odo import odo\n", "# import other libraries we will use\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "dshape(\"\"\"var * {\n", " event_id: ?float64,\n", " asof_date: datetime,\n", " trade_date: ?datetime,\n", " symbol: ?string,\n", " event_type: ?string,\n", " event_headline: ?string,\n", " clinical_phase: ?string,\n", " clinical_scope: ?string,\n", " clinical_result: ?string,\n", " product_name: ?string,\n", " event_rating: ?float64,\n", " timestamp: datetime,\n", " sid: ?int64\n", " }\"\"\")" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Let's use blaze to understand the data a bit using Blaze dshape()\n", "clinical_trials.dshape" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "9118" ], "text/plain": [ "9118" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# And how many rows are there?\n", "# N.B. we're using a Blaze function to do this, not len()\n", "clinical_trials.count()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
event_idasof_datetrade_datesymbolevent_typeevent_headlineclinical_phaseclinical_scopeclinical_resultproduct_nameevent_ratingtimestampsid
01383032007-01-032007-01-03IMCLClinical TrialsImClone Systems Commences Patient Treatment in...Phase INaNNaNIMC-3G312007-01-043871
11381802007-01-042007-01-04DNAClinical TrialsGenentech Announces Positive Results From Rand...Phase IINaNPositivePertuzumab12007-01-0524847
29527592007-01-042007-01-04VICLClinical TrialsVical Initiates Pivotal Phase 3 Trial of Allov...Phase IIINaNNaNAllovectin-712007-01-058763
" ], "text/plain": [ " event_id asof_date trade_date symbol event_type \\\n", "0 138303 2007-01-03 2007-01-03 IMCL Clinical Trials \n", "1 138180 2007-01-04 2007-01-04 DNA Clinical Trials \n", "2 952759 2007-01-04 2007-01-04 VICL Clinical Trials \n", "\n", " event_headline clinical_phase \\\n", "0 ImClone Systems Commences Patient Treatment in... Phase I \n", "1 Genentech Announces Positive Results From Rand... Phase II \n", "2 Vical Initiates Pivotal Phase 3 Trial of Allov... Phase III \n", "\n", " clinical_scope clinical_result product_name event_rating timestamp sid \n", "0 NaN NaN IMC-3G3 1 2007-01-04 3871 \n", "1 NaN Positive Pertuzumab 1 2007-01-05 24847 \n", "2 NaN NaN Allovectin-7 1 2007-01-05 8763 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Let's see what the data looks like. We'll grab the first three rows.\n", "clinical_trials[:3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's go over the columns:\n", "- **event_id**: the unique identifier for this clinical trial.\n", "- **asof_date**: EventVestor's timestamp of event capture.\n", "- **trade_date**: for event announcements made before trading ends, trade_date is the same as event_date. For announcements issued after market close, trade_date is next market open day.\n", "- **symbol**: stock ticker symbol of the affected company.\n", "- **event_type**: this should always be *Clinical Trials*.\n", "- **event_headline**: a short description of the event.\n", "- **clinical_phase**: phases include *0, I, II, III, IV, Pre-Clinical*\n", "- **clinical_scope**: types of scope include *additional indications, all indications, limited indications*\n", "- **clinical_result**: result types include *negative, partial, positive*\n", "- **product_name**: name of the drug being investigated.\n", "- **event_rating**: this is always 1. The meaning of this is uncertain.\n", "- **timestamp**: this is our timestamp on when we registered the data.\n", "- **sid**: the equity's unique identifier. Use this instead of the symbol." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We've done much of the data processing for you. Fields like `timestamp` and `sid` are standardized across all our Store Datasets, so the datasets are easy to combine. We have standardized the `sid` across all our equity databases.\n", "\n", "We can select columns and rows with ease. Below, we'll fetch all phase-3 announcements. We'll only display the columns for the sid and the drug name." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
timestampsidproduct_name
02007-01-058763Allovectin-7
12007-01-091416FENTORA
22007-01-113871ERBITUX
32007-01-258763Allovectin-7
42007-02-0924415Xibrom
52007-02-2324847Avastin
62007-04-053871ERBITUX (Cetuximab)
72007-04-113871ERBITUX
82007-04-173871ERBITUX (Cetuximab)
92007-04-2623846BEMA Fentanyl
102007-04-275847Nuvion
" ], "text/plain": [ " timestamp sid product_name\n", "0 2007-01-05 8763 Allovectin-7\n", "1 2007-01-09 1416 FENTORA \n", "2 2007-01-11 3871 ERBITUX\n", "3 2007-01-25 8763 Allovectin-7\n", "4 2007-02-09 24415 Xibrom\n", "5 2007-02-23 24847 Avastin\n", "6 2007-04-05 3871 ERBITUX (Cetuximab)\n", "7 2007-04-11 3871 ERBITUX\n", "8 2007-04-17 3871 ERBITUX (Cetuximab) \n", "9 2007-04-26 23846 BEMA Fentanyl\n", "..." ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "phase_three = clinical_trials[clinical_trials.clinical_phase == \"Phase III\"][['timestamp', 'sid','product_name']].sort('timestamp')\n", "# When displaying a Blaze Data Object, the printout is automatically truncated to ten rows.\n", "phase_three" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, suppose we want a DataFrame of GlaxoSmithKline Phase-III announcements, sorted in descending order by date:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "gsk_sid = symbols('GSK').sid" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
event_idasof_datetrade_datesymbolevent_typeevent_headlineclinical_phaseclinical_scopeclinical_resultproduct_nameevent_ratingtimestampsid
019372022015-09-272015-09-28GSKClinical TrialsGlaxoSmithKline Reports Positive Results From ...Phase IIINaNPositiveAnoro Ellipta12015-09-29 11:17:13.1218383242
318368522015-02-092015-02-09GSKClinical TrialsGlaxoSmithKline and Theravance Initiate Phase ...Phase IIINaNNaNfluticasone furoate/umeclidinium/vilanterol (12015-02-10 00:00:003242
418173312014-12-182014-12-18GSKClinical TrialsGlaxoSmithKline Reports ZOE-50 Phase 3 Study M...Phase IIINaNPositiveZOE-5012014-12-19 00:00:003242
517459872014-07-162014-07-16GSKClinical TrialsGlaxoSmithKline & Theravance Initiates Phase I...Phase IIINaNNaNIMPACT12014-07-17 00:00:003242
617385662014-06-252014-06-25GSKClinical TrialsGlaxoSmithKline Initiates Phase 3 Study with E...Phase IIINaNNaNEltrombopag12014-06-26 00:00:003242
717350912014-06-132014-06-13GSKClinical TrialsGlaxoSmithKline Reports Phase 3 PETIT2 Study M...Phase IIINaNPositivePETIT212014-06-14 00:00:003242
817342162014-06-112014-06-11GSKClinical TrialsGlaxoSmithKline Reports Positive Results from ...Phase IIINaNPositiveIncruse Ellipta12014-06-12 00:00:003242
1017072652014-04-222014-04-22GSKClinical TrialsGlaxoSmithKline and Theravance Starts Phase II...Phase IIINaNNaNFF/VI12014-04-23 00:00:003242
1117001572014-04-022014-04-02GSKClinical TrialsGlaxoSmithKline to Stop MAGE-A3 Cancer Immunot...Phase IIINaNNaNMAGRITi12014-04-03 00:00:003242
1216955262014-03-202014-03-20GSKClinical TrialsGlaxoSmithKline's MAGE-A3 Cancer Immunotherape...Phase IIINaNNegativeMAGE-A312014-03-21 00:00:003242
1316931812014-03-142014-03-14GSKClinical TrialsGlaxoSmithKline & Theravance Reports Positve R...Phase IIINaNPositiveAnoro Ellipta12014-03-15 00:00:003242
1516534852013-12-062013-12-06GSKClinical TrialsGlaxoSmithKline and Theravance Announces Posit...Phase IIINaNPositiveFluticasone Furoate12013-12-07 00:00:003242
1716473842013-11-122013-11-12GSKClinical TrialsGlaxoSmithKline Announces Phase III Stability ...Phase IIINaNNegativeDarapladib12013-11-13 00:00:003242
1816204762013-09-052013-09-05GSKClinical TrialsGlaxoSmithKline's MAGE-A3 Vaccine Fails to Mee...Phase IIINaNNegativeMAGE-A312013-09-06 00:00:003242
1915216032012-12-192012-12-20GSKClinical TrialsGlaxoSmithKline, Amicus Therapeutics Announce ...Phase IIINaNNegativeMigalastat HCl12012-12-20 00:00:003242
2114742912012-08-242012-08-24GSKClinical TrialsGlaxoSmithKline, Theravance Complete Phase III...Phase IIINaNNaNLAMA/LABA12012-08-25 00:00:003242
2214514832012-07-112012-07-11GSKClinical TrialsShionogi-ViiV Healthcare Reports Positive Init...Phase IIINaNPositiveING11446712012-07-12 00:00:003242
2314516242012-07-112012-07-11GSKClinical TrialsGlaxoSmithKline Reports Positive Results in Ph...Phase IIINaNPositiveAlbiglutide12012-07-12 00:00:003242
2414489472012-07-022012-07-02GSKClinical TrialsTheravance and GlaxoSmithKline Report Positive...Phase IIINaNPositiveLAMA/LABA12012-07-03 00:00:003242
2614148862012-04-032012-04-03GSKClinical TrialsGlaxoSmithKline Reports Further Positive Resul...Phase IIINaNPositiveAlbiglutide12012-04-04 00:00:003242
2713817342012-01-092012-01-09GSKClinical TrialsGlaxoSmithKline, Theravance Report Initial Res...Phase IIINaNPartialRelovair12012-01-10 00:00:003242
2813762422011-12-152011-12-15GSKClinical TrialsGlaxoSmithKline and Human Genome Initiate Phas...Phase IIINaNNaNBENLYSTA12011-12-16 00:00:003242
2913528592011-10-182011-10-18GSKClinical TrialsGlaxoSmithKline Reports Positive Results from ...Phase IIINaNPositiveRTS,S12011-10-19 00:00:003242
3013511452011-10-112011-10-11GSKClinical TrialsGlaxoSmithKline and Pfizer JV Initiates Phase ...Phase IIINaNNaNCelsentri/Selzentry; emtricitabine/tenofovir12011-10-12 00:00:003242
3113365732011-09-122011-09-12GSKClinical TrialsGlaxoSmithKline and Amicus Therapeutics Initia...Phase IIINaNNaNAmigal12011-09-13 00:00:003242
3213354272011-08-152011-08-15GSKClinical TrialsGlaxoSmithKline Reports Positive Results for I...Phase IIINaNPositiveIPX06612011-08-16 00:00:003242
3313321952011-07-262011-07-26GSKClinical TrialsGlaxoSmithKline Reports Positive Data from Pro...Phase IIINaNPositiveENABLE-112011-07-27 00:00:003242
3413017392011-06-022011-06-02GSKClinical TrialsGlaxoSmithKline and Theravance Announce Positi...Phase IIINaNPositiveRelovair12011-06-03 00:00:003242
3612495262011-02-072011-02-07GSKClinical TrialsGlaxoSmithKline, Human Genome Announce Positiv...Phase IIINaNPositiveBENLYSTA12011-02-08 00:00:003242
3712492892011-02-032011-02-03GSKClinical TrialsGSK and Theravance Announce Progression of LAM...Phase IIINaNPositiveGSK573719/vilanterol12011-02-04 00:00:003242
3911882822010-10-212010-10-21GSKClinical TrialsGlaxoSmithKline JV Initiates Phase III Trial f...Phase IIINaNNaNS/GSK134957212010-10-22 00:00:003242
4211263012010-06-172010-06-17GSKClinical TrialsGlaxoSmithKline Announces Positive Result in P...Phase IIINaNPartialBENLYSTA12010-06-18 00:00:003242
4311263322010-06-172010-06-17GSKClinical TrialsGlaxoSmithKline Announces Positive Phase 3 Res...Phase IIINaNPositiveBENLYSTA12010-06-18 00:00:003242
4410894242010-04-202010-04-20GSKClinical TrialsGlaxoSmithKline, Human Genome Announce Failure...Phase IIILimited IndicationsNegativeBENLYSTA12010-04-21 00:00:003242
4610040932009-11-022009-11-02GSKClinical TrialsGlaxoSmithKline Reports Positive Results in Se...Phase IIINaNPositiveBENLYSTA12009-11-03 00:00:003242
4710000322009-10-272009-10-27GSKClinical TrialsGlaxoSmithKline Commences Phase III Horizon Pr...Phase IIINaNNaNCOPD12009-10-28 00:00:003242
489768522009-10-202009-10-20GSKClinical TrialsGlaxoSmithKline Announces Positive Phase3 Resu...Phase IIINaNPositiveBelimumab12009-10-21 00:00:003242
535376942009-02-172009-02-17GSKClinical TrialsGSK Initiates Phase III Programme for Novel Ty...Phase IIINaNNaNGLP-112009-02-18 00:00:003242
565224332008-12-062008-12-08GSKClinical TrialsGSK, Valeant's Retigabine Reduces Seizures in ...Phase IIINaNPositiveRetigabine12008-12-07 00:00:003242
701476542008-02-282008-02-28GSKClinical TrialsGlaxoSmithKline and XenoPort Get Positive Resu...Phase IIINaNPositiveXP1351212008-02-29 00:00:003242
\n", "
" ], "text/plain": [ " event_id asof_date trade_date symbol event_type \\\n", "0 1937202 2015-09-27 2015-09-28 GSK Clinical Trials \n", "3 1836852 2015-02-09 2015-02-09 GSK Clinical Trials \n", "4 1817331 2014-12-18 2014-12-18 GSK Clinical Trials \n", "5 1745987 2014-07-16 2014-07-16 GSK Clinical Trials \n", "6 1738566 2014-06-25 2014-06-25 GSK Clinical Trials \n", "7 1735091 2014-06-13 2014-06-13 GSK Clinical Trials \n", "8 1734216 2014-06-11 2014-06-11 GSK Clinical Trials \n", "10 1707265 2014-04-22 2014-04-22 GSK Clinical Trials \n", "11 1700157 2014-04-02 2014-04-02 GSK Clinical Trials \n", "12 1695526 2014-03-20 2014-03-20 GSK Clinical Trials \n", "13 1693181 2014-03-14 2014-03-14 GSK Clinical Trials \n", "15 1653485 2013-12-06 2013-12-06 GSK Clinical Trials \n", "17 1647384 2013-11-12 2013-11-12 GSK Clinical Trials \n", "18 1620476 2013-09-05 2013-09-05 GSK Clinical Trials \n", "19 1521603 2012-12-19 2012-12-20 GSK Clinical Trials \n", "21 1474291 2012-08-24 2012-08-24 GSK Clinical Trials \n", "22 1451483 2012-07-11 2012-07-11 GSK Clinical Trials \n", "23 1451624 2012-07-11 2012-07-11 GSK Clinical Trials \n", "24 1448947 2012-07-02 2012-07-02 GSK Clinical Trials \n", "26 1414886 2012-04-03 2012-04-03 GSK Clinical Trials \n", "27 1381734 2012-01-09 2012-01-09 GSK Clinical Trials \n", "28 1376242 2011-12-15 2011-12-15 GSK Clinical Trials \n", "29 1352859 2011-10-18 2011-10-18 GSK Clinical Trials \n", "30 1351145 2011-10-11 2011-10-11 GSK Clinical Trials \n", "31 1336573 2011-09-12 2011-09-12 GSK Clinical Trials \n", "32 1335427 2011-08-15 2011-08-15 GSK Clinical Trials \n", "33 1332195 2011-07-26 2011-07-26 GSK Clinical Trials \n", "34 1301739 2011-06-02 2011-06-02 GSK Clinical Trials \n", "36 1249526 2011-02-07 2011-02-07 GSK Clinical Trials \n", "37 1249289 2011-02-03 2011-02-03 GSK Clinical Trials \n", "39 1188282 2010-10-21 2010-10-21 GSK Clinical Trials \n", "42 1126301 2010-06-17 2010-06-17 GSK Clinical Trials \n", "43 1126332 2010-06-17 2010-06-17 GSK Clinical Trials \n", "44 1089424 2010-04-20 2010-04-20 GSK Clinical Trials \n", "46 1004093 2009-11-02 2009-11-02 GSK Clinical Trials \n", "47 1000032 2009-10-27 2009-10-27 GSK Clinical Trials \n", "48 976852 2009-10-20 2009-10-20 GSK Clinical Trials \n", "53 537694 2009-02-17 2009-02-17 GSK Clinical Trials \n", "56 522433 2008-12-06 2008-12-08 GSK Clinical Trials \n", "70 147654 2008-02-28 2008-02-28 GSK Clinical Trials \n", "\n", " event_headline clinical_phase \\\n", "0 GlaxoSmithKline Reports Positive Results From ... Phase III \n", "3 GlaxoSmithKline and Theravance Initiate Phase ... Phase III \n", "4 GlaxoSmithKline Reports ZOE-50 Phase 3 Study M... Phase III \n", "5 GlaxoSmithKline & Theravance Initiates Phase I... Phase III \n", "6 GlaxoSmithKline Initiates Phase 3 Study with E... Phase III \n", "7 GlaxoSmithKline Reports Phase 3 PETIT2 Study M... Phase III \n", "8 GlaxoSmithKline Reports Positive Results from ... Phase III \n", "10 GlaxoSmithKline and Theravance Starts Phase II... Phase III \n", "11 GlaxoSmithKline to Stop MAGE-A3 Cancer Immunot... Phase III \n", "12 GlaxoSmithKline's MAGE-A3 Cancer Immunotherape... Phase III \n", "13 GlaxoSmithKline & Theravance Reports Positve R... Phase III \n", "15 GlaxoSmithKline and Theravance Announces Posit... Phase III \n", "17 GlaxoSmithKline Announces Phase III Stability ... Phase III \n", "18 GlaxoSmithKline's MAGE-A3 Vaccine Fails to Mee... Phase III \n", "19 GlaxoSmithKline, Amicus Therapeutics Announce ... Phase III \n", "21 GlaxoSmithKline, Theravance Complete Phase III... Phase III \n", "22 Shionogi-ViiV Healthcare Reports Positive Init... Phase III \n", "23 GlaxoSmithKline Reports Positive Results in Ph... Phase III \n", "24 Theravance and GlaxoSmithKline Report Positive... Phase III \n", "26 GlaxoSmithKline Reports Further Positive Resul... Phase III \n", "27 GlaxoSmithKline, Theravance Report Initial Res... Phase III \n", "28 GlaxoSmithKline and Human Genome Initiate Phas... Phase III \n", "29 GlaxoSmithKline Reports Positive Results from ... Phase III \n", "30 GlaxoSmithKline and Pfizer JV Initiates Phase ... Phase III \n", "31 GlaxoSmithKline and Amicus Therapeutics Initia... Phase III \n", "32 GlaxoSmithKline Reports Positive Results for I... Phase III \n", "33 GlaxoSmithKline Reports Positive Data from Pro... Phase III \n", "34 GlaxoSmithKline and Theravance Announce Positi... Phase III \n", "36 GlaxoSmithKline, Human Genome Announce Positiv... Phase III \n", "37 GSK and Theravance Announce Progression of LAM... Phase III \n", "39 GlaxoSmithKline JV Initiates Phase III Trial f... Phase III \n", "42 GlaxoSmithKline Announces Positive Result in P... Phase III \n", "43 GlaxoSmithKline Announces Positive Phase 3 Res... Phase III \n", "44 GlaxoSmithKline, Human Genome Announce Failure... Phase III \n", "46 GlaxoSmithKline Reports Positive Results in Se... Phase III \n", "47 GlaxoSmithKline Commences Phase III Horizon Pr... Phase III \n", "48 GlaxoSmithKline Announces Positive Phase3 Resu... Phase III \n", "53 GSK Initiates Phase III Programme for Novel Ty... Phase III \n", "56 GSK, Valeant's Retigabine Reduces Seizures in ... Phase III \n", "70 GlaxoSmithKline and XenoPort Get Positive Resu... Phase III \n", "\n", " clinical_scope clinical_result \\\n", "0 NaN Positive \n", "3 NaN NaN \n", "4 NaN Positive \n", "5 NaN NaN \n", "6 NaN NaN \n", "7 NaN Positive \n", "8 NaN Positive \n", "10 NaN NaN \n", "11 NaN NaN \n", "12 NaN Negative \n", "13 NaN Positive \n", "15 NaN Positive \n", "17 NaN Negative \n", "18 NaN Negative \n", "19 NaN Negative \n", "21 NaN NaN \n", "22 NaN Positive \n", "23 NaN Positive \n", "24 NaN Positive \n", "26 NaN Positive \n", "27 NaN Partial \n", "28 NaN NaN \n", "29 NaN Positive \n", "30 NaN NaN \n", "31 NaN NaN \n", "32 NaN Positive \n", "33 NaN Positive \n", "34 NaN Positive \n", "36 NaN Positive \n", "37 NaN Positive \n", "39 NaN NaN \n", "42 NaN Partial \n", "43 NaN Positive \n", "44 Limited Indications Negative \n", "46 NaN Positive \n", "47 NaN NaN \n", "48 NaN Positive \n", "53 NaN NaN \n", "56 NaN Positive \n", "70 NaN Positive \n", "\n", " product_name event_rating \\\n", "0 Anoro Ellipta 1 \n", "3 fluticasone furoate/umeclidinium/vilanterol ( 1 \n", "4 ZOE-50 1 \n", "5 IMPACT 1 \n", "6 Eltrombopag 1 \n", "7 PETIT2 1 \n", "8 Incruse Ellipta 1 \n", "10 FF/VI 1 \n", "11 MAGRITi 1 \n", "12 MAGE-A3 1 \n", "13 Anoro Ellipta 1 \n", "15 Fluticasone Furoate 1 \n", "17 Darapladib 1 \n", "18 MAGE-A3 1 \n", "19 Migalastat HCl 1 \n", "21 LAMA/LABA 1 \n", "22 ING114467 1 \n", "23 Albiglutide 1 \n", "24 LAMA/LABA 1 \n", "26 Albiglutide 1 \n", "27 Relovair 1 \n", "28 BENLYSTA 1 \n", "29 RTS,S 1 \n", "30 Celsentri/Selzentry; emtricitabine/tenofovir 1 \n", "31 Amigal 1 \n", "32 IPX066 1 \n", "33 ENABLE-1 1 \n", "34 Relovair 1 \n", "36 BENLYSTA 1 \n", "37 GSK573719/vilanterol 1 \n", "39 S/GSK1349572 1 \n", "42 BENLYSTA 1 \n", "43 BENLYSTA 1 \n", "44 BENLYSTA 1 \n", "46 BENLYSTA 1 \n", "47 COPD 1 \n", "48 Belimumab 1 \n", "53 GLP-1 1 \n", "56 Retigabine 1 \n", "70 XP13512 1 \n", "\n", " timestamp sid \n", "0 2015-09-29 11:17:13.121838 3242 \n", "3 2015-02-10 00:00:00 3242 \n", "4 2014-12-19 00:00:00 3242 \n", "5 2014-07-17 00:00:00 3242 \n", "6 2014-06-26 00:00:00 3242 \n", "7 2014-06-14 00:00:00 3242 \n", "8 2014-06-12 00:00:00 3242 \n", "10 2014-04-23 00:00:00 3242 \n", "11 2014-04-03 00:00:00 3242 \n", "12 2014-03-21 00:00:00 3242 \n", "13 2014-03-15 00:00:00 3242 \n", "15 2013-12-07 00:00:00 3242 \n", "17 2013-11-13 00:00:00 3242 \n", "18 2013-09-06 00:00:00 3242 \n", "19 2012-12-20 00:00:00 3242 \n", "21 2012-08-25 00:00:00 3242 \n", "22 2012-07-12 00:00:00 3242 \n", "23 2012-07-12 00:00:00 3242 \n", "24 2012-07-03 00:00:00 3242 \n", "26 2012-04-04 00:00:00 3242 \n", "27 2012-01-10 00:00:00 3242 \n", "28 2011-12-16 00:00:00 3242 \n", "29 2011-10-19 00:00:00 3242 \n", "30 2011-10-12 00:00:00 3242 \n", "31 2011-09-13 00:00:00 3242 \n", "32 2011-08-16 00:00:00 3242 \n", "33 2011-07-27 00:00:00 3242 \n", "34 2011-06-03 00:00:00 3242 \n", "36 2011-02-08 00:00:00 3242 \n", "37 2011-02-04 00:00:00 3242 \n", "39 2010-10-22 00:00:00 3242 \n", "42 2010-06-18 00:00:00 3242 \n", "43 2010-06-18 00:00:00 3242 \n", "44 2010-04-21 00:00:00 3242 \n", "46 2009-11-03 00:00:00 3242 \n", "47 2009-10-28 00:00:00 3242 \n", "48 2009-10-21 00:00:00 3242 \n", "53 2009-02-18 00:00:00 3242 \n", "56 2008-12-07 00:00:00 3242 \n", "70 2008-02-29 00:00:00 3242 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gsk = clinical_trials[clinical_trials.sid==gsk_sid].sort('timestamp',ascending=False)\n", "gsk_df = odo(gsk, pd.DataFrame)\n", "# now filter down to the Phase 4 trials\n", "gsk_df = gsk_df[gsk_df.clinical_phase==\"Phase III\"]\n", "gsk_df" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }