Sum values in column B, given condition in all dates in column A
=sumif(A4:A1000,"<="&TODAY(),B4:B1000)
Sum values in column B, given condition in all dates in column A
=sumif(A4:A1000,"<="&TODAY(),B4:B1000)
| # Instead of abusing black.vercel.app for over 3 years, I finally wrote a | |
| # little utility to take clipboard Python code, format with Black, and | |
| # finally copy formatted code to clipboard, and output using bat. | |
| # add to a zsh file in ~/.oh-my-zsh/custom/ | |
| # and/or to .zshenv | |
| # Required | |
| # ======== | |
| # |
| grid = [ | |
| [1, 3, 2, 5, 4, 6, 9, 8, 7], | |
| [4, 6, 5, 8, 7, 9, 3, 2, 1], | |
| [7, 9, 8, 2, 1, 3, 6, 5, 4], | |
| [9, 2, 1, 4, 3, 5, 8, 7, 6], | |
| [3, 5, 4, 7, 6, 8, 2, 1, 9], | |
| [6, 8, 7, 1, 9, 2, 5, 4, 3], | |
| [5, 7, 6, 9, 8, 1, 4, 3, 2], | |
| [2, 4, 3, 6, 5, 7, 1, 9, 8], | |
| [8, 1, 9, 3, 2, 4, 7, 6, 5], |
| # Instead of repeating yourself | |
| df["started_at"] = pd.to_datetime(df["started_at") | |
| df["ended_at"] = pd.to_datetime(df["ended_at"]) | |
| # Leverage the power of pipe | |
| df.pipe( | |
| lambda x: x.assign( | |
| **{ # Apply same function to both columns in one go | |
| col: pd.to_datetime(x[col], format="%Y-%m-%d %H:%M:%S") | |
| for col in ["started_at", "ended_at"] |
Example:
example = {
("Rock", "Rock"): "Draw",
("Rock", "Paper"): "Win",
("Rock", "Scissors"): "Loss",
("Paper", "Rock"): "Loss",
("Paper", "Paper"): "Draw",
("Paper", "Scissors"): "Win",| import re | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| from sqlalchemy import create_engine | |
| def sql_query(query: str) -> pd.DataFrame: | |
| """ | |
| Helper function to run SQL queries on in-house Pandas DataFrames |
| ╔═══════════╦═════════════════╦════════╦════════════════════════════════════════════════════════════════════════════════════╗ | |
| ║ RNUM ║ QNAME ║ YEAR ║ DESCRIPTION ║ | |
| ╠═══════════╬═════════════════╬════════╬════════════════════════════════════════════════════════════════════════════════════╣ | |
| ║ R00001.00 ║ case_id ║ 1979 ║ ORIGINAL QUESTION NAME: CASEID ║ | |
| ║ ║ ║ ║ ║ | |
| ║ ║ ║ ║ NOTE: THIS NUMBER WAS ASSIGNED ACCORDING TO THE RECORD NUMBER OF EACH RESPONDENT ║ | |
| ║ ║ ║ ║ ON THE TAPE. THE FIRST RESPONDENT WAS ASSIGNED ID#1, THE SECOND WAS ASSIGNED ║ | |
| ║ ║ ║ ║ ID#2, ETC. ║ | |
| ╠═══════════╬═══ |
Install Espanso by downloading the file from here
| /* PrismJS 1.27.0 | |
| https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+python */ | |
| code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*= |