This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import numpy as np | |
#=========================================== | |
#%% Index and element wise operation | |
#=========================================== | |
#%% logical indexing | |
data = np.random.randn(7,4) | |
names = np.array(['Bob', 'Joe', 'Will', 'Bob', 'Will', 'Joe', 'Joe']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match.py | |
replace.py | |
search.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s.index(s2, i, j) #Index of first occurrence of s2 in s after index i and before index j | |
s.find(s2) #Find and return lowest index of s2 in s | |
s.index(s2) #Return lowest index of s2 in s (but raise ValueError if not found) | |
s.replace(s2, s3) #Replace s2 with s3 in s | |
s.replace(s2, s3, count) #Replace s2 with s3 in s at most count times | |
s.rfind(s2) #Return highest index of s2 in s | |
s.rindex(s2) #Return highest index of s2 in s (raise ValueError if not found) | |
#=================================================== | |
#Regexp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# csv.py: csv file io | |
# file.py: operation related to files | |
# directory.py: operation related to finding files and traveling directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file list: | |
# base.py | |
# element.py (how to get content of element) | |
# form.py | |
# javascript.py | |
# selector.py | |
# wait.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xml document | |
# edit.py | |
# encode.py | |
# extract.py | |
# namespace.py | |
# search.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 10_basic.py | |
# 15_make_soup.py | |
# 20_search.py | |
# 25_navigation.py | |
# 30_edit.py | |
# 40_encoding.py | |
# 50_parse_only_part.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def html2markdown(self, html): | |
# convert html to markdown. | |
# specification: | |
# remove all tag exccept tags listed in the cleanbody._repl | |
# when p/div tags are in the table tag, markdown converter (htmlformatter) | |
# confuses. so it is removed | |
# we need following in the header | |
# import re, html2text | |
# from bs4 import BeautifulSoup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1_loop.py | |
# 2_list_operation.py |
OlderNewer