What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-02 05:28:02
append and delete hackerrank solution in python
if __name__ == '__main__': s = input().strip() t = input().strip() k = int(input().strip()) min_len = min(len(s), len(t)) first_different_index = min_len for i in range(min_len): if s[i] != t[i]: first_differen... Add solution -
Other 2021-09-27 21:11:03
reading doc in python
from bs4 import BeautifulSoup as bs soup = bs(open(filename).read()) [s.extract() for s in soup(['style', 'script'])] tmpText = soup.get_text() text = "".join("".join(tmpText.split('\t')).split('\n')).encode('utf-8').strip() print text Add solution -
Python 2021-09-25 22:34:02
string methods to clean column dataframe
def clean_col(col): col = col.strip() col = col.replace("(","") col = col.replace(")","") col = col.lower() return col new_columns = [] for c in df.columns: clean_c = clean_col(c) new_co... Add solution