This file contains 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
javascript:(()=>{window.location.href = `https://archive.is/submit/?url=${window.location.href}`})(); |
This file contains 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
window.addEventListener('scroll', (evt) => { | |
const loadMoreBtn = document.querySelector('.loadMoreBtn'); | |
if ((loadMoreBtn.offsetTop) < (scrollY + 1000)) { | |
loadMoreBtn.click(); | |
} | |
}); |
This file contains 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
### Merge two dataframes when both have a common column with common values (e.g. id) | |
pd.merge(df1, df2, how='inner', on='id') |
- Leetcode
- HackerRank
- hackerearth
- codewars
- Project Euler
- [InterviewBit](https://www.interviewbit.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# use ImageMagick convert | |
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
This file contains 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
import numpy as np | |
import pandas as pd | |
#### creating dataframes, adding and dropping columns | |
df = pd.DataFrame(np.arange(1,10).reshape(3,3),['A','B','C'],['w','x','y']) | |
df.columns = ['W','X','Y'] # change column names | |
df['Z']=df['X']+df['Y'] # new column with values X+Y | |
df['XX']=df.apply(lambda row: row['X']*2, axis=1) # new column with values twice of column X | |
df['YY']=1 # new column of ones |
NewerOlder