Skip to content

Instantly share code, notes, and snippets.

@yoki
yoki / 00_pandas.py
Last active January 26, 2023 07:21
Pandas tutorial
# 10_generation
# 11_filter
# 12_setting_value
# 13_io
# 15_groupby
# 16_merge
# 17_pivot_reshape
# 18_misc
# 19_type
# 21_category
# csv.py: csv file io
# file.py: operation related to files
# directory.py: operation related to finding files and traveling directory
@yoki
yoki / find_replace.py
Last active December 10, 2022 05:17
Python String
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