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
| for file in *.jpg; do convert $file -resize 1800x res-$file; done | |
| # 1800x šířka 1800 px | |
| # x1000 výška 1000 px |
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
| df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}) | |
| #----------------------- | |
| # empty df | |
| df = pd.DataFrame({'col1': [], | |
| 'col2': [], | |
| 'col3': []}) |
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
| DF = pd.read_csv('data/nyc-jobs.csv') | |
| new_columns = [column.replace(' ', '_').lower() for column in DF] | |
| DF.columns = new_columns |
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
| for _, row in df.iterrows(): | |
| print(row["name"]) |
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
| DROP SCHEMA public CASCADE; CREATE SCHEMA public; GRANT USAGE ON SCHEMA public to PUBLIC; GRANT CREATE ON SCHEMA public to PUBLIC; COMMENT ON SCHEMA public IS 'standard public schema'; |
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
| print(item, sep=' ', end='', flush=True) |
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
| import sys | |
| # These are the usual ipython objects, including this one you are creating | |
| ipython_vars = ['In', 'Out', 'exit', 'quit', 'get_ipython', 'ipython_vars'] | |
| # Get a sorted list of the objects and their sizes | |
| sorted([(x, sys.getsizeof(globals().get(x))) for x in dir() if not x.startswith('_') and x not in sys.modules and x not in ipython_vars], key=lambda x: x[1], reverse=True) |
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
| # změna velikosti SWAP souboru na 8GB | |
| # https://forums.linuxmint.com/viewtopic.php?t=284301 | |
| # https://linuxhint.com/change_swap_size_ubuntu/ | |
| swapon # kontrola velikosti na začátku | |
| sudo swapoff -a | |
| sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 | |
| sudo chmod 0600 /swapfile | |
| sudo mkswap /swapfile |
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
| $ jupyter notebook stop 8889 |
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
| df['sex_letter] = df.sex.map({'Male': 'M', 'Female': 'F'}).fillna('O') |