Skip to content

Instantly share code, notes, and snippets.

@ytakashina
Last active November 16, 2017 07:27
Show Gist options
  • Save ytakashina/613290587e89e7f9f442271155baaa99 to your computer and use it in GitHub Desktop.
Save ytakashina/613290587e89e7f9f442271155baaa99 to your computer and use it in GitHub Desktop.
Jupyter notebook の import 用 snippets 。
  • data
import tqdm
import pickle
import numpy as np
import scipy
import sklearn
import pandas as pd
import plotly
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
sns.set_style('ticks')
# seaborn.set(style='ticks', font='TakaoGothic')
matplotlib.rcParams['pdf.fonttype'] = 42
plotly.offline.init_notebook_mode(connected=True)
palette = sns.color_palette("RdBu_r", n_colors=25)
% matplotlib inline
  • preprocessing/scraping
import tqdm
import os
import re
import bs4
import time
import requests
import pandas as pd
import string
import random
import numpy as np
  • language
import MeCab
m = MeCab.Tagger(' -d /usr/lib/mecab/dic/mecab-ipadic-neologd -F%f[6],%f[0], -U%m,, -EEOS,EOS') # with POS
# m = MeCab.Tagger(' -d /usr/lib/mecab/dic/mecab-ipadic-neologd -F%f[6], -U%m,, -EEOS') # without POS
  • network
import tqdm
import networkx as nx
# igraph, graph-tool
import seaborn as sns
import matplotlib.pyplot as plt
% matplotlib inline
sns.set_style('ticks')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment