Skip to content

Instantly share code, notes, and snippets.

View titipata's full-sized avatar
:octocat:

Titipat Achakulvisut titipata

:octocat:
View GitHub Profile
@titipata
titipata / teaching_python.ipynb
Created February 16, 2017 21:56
sample notebook from Kording lab teaching Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@titipata
titipata / wos_extract.md
Last active November 15, 2016 17:24
WoS extract

Web of Science parser

Download dependencies

import xml.etree.cElementTree as ET
from lxml import etree
from itertools import chain
import pandas as pd
@titipata
titipata / parse_table_pubmed_oa.md
Last active October 6, 2016 23:29
Parse table from Pubmed Open-Access XML

Parse table from Pubmed OA

Here is a Python script to parse table from example xml file

from lxml import etree
from itertools import chain

def stringify_children(node):
    """

Parse Pubmed xml using Python (NLTK class)

You need lxml library to parse xml file (use pip install lxml or sudo pip install lxml)

import pandas as pd
from lxml import etree
from lxml.etree import tostring
from itertools import chain
@titipata
titipata / search_through_excel.md
Last active February 26, 2016 00:52
Yasin's read excel and produce search

You need to install Python and pandas library before running this script.

Assuming we have .xlsx sheet sit right at where we run Python script.

sheets = pd.ExcelFile('Lista de e-mails & Email List.xlsx') # use pandas to read excel sheets
search_sheet = pd.read_excel('Exampl names.xls', header=None)[[2]].rename(columns={2: 'search_name'}) # also use to read search name

Here, I create function to parse excel sheets and grab all name founded in documents then concat them together

@titipata
titipata / LDA implementation.ipynb
Created January 29, 2016 19:40
Linear discriminant analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

##Solr installation

not finalize yet

First change directory to solr-5.4.0 and start solr

cd /opt/solr-5.4.0
sudo ./bin/solr start -c -m 50g
@titipata
titipata / lagrangian.md
Last active January 24, 2016 20:49
Snippet for Lagrangian Mechanics

Douple Pendulum Snippet (Thai)

(*ตัวแปรสำหรับสมการลากรานจ์*)
q = {{theta1[t]}, {theta2[t]}};
dq = D[q, t];
ddq = D[dq, t];
@titipata
titipata / imdb.md
Last active December 18, 2015 01:08

#Dowload IMDB data for LSTM example

Here is a snippet to download python code and imdb.pkl

wget http://deeplearning.net/tutorial/code/imdb.py
wget http://deeplearning.net/tutorial/code/lstm.py
wget http://www.iro.umontreal.ca/~lisa/deep/data/imdb.pkl