- Dictionary to DataFrame
df = pd.Dataframe(my_dict)- Dictionary to DataFrame with row labels
| # Loop through list | |
| for item in list: | |
| print(item) | |
| # Loop through list with index | |
| for index, item in enumerate(list): | |
| print(index, item) | |
| # Loop through dictinary: | |
| for key, value in dict.items(): |
| # Print without line break | |
| print('*', end='') | |
| # Print without spaces between arguments | |
| print('a', 'b', 'c', sep='') | |
| # Flush the output in case of buffering problems | |
| print('*', end='', flush=True) | |
| # String formatting: https://docs.python.org/3/library/string.html#formatstrings |
| imputer = Imputer(missing_values='NaN', strategy='mean', axis=0) | |
| # imputer = Imputer(missing_values='NaN', strategy='median', axis=0) | |
| # imputer = Imputer(missing_values='NaN', strategy='most_frequent', axis=0) | |
| # imputer = Imputer(missing_values=0, strategy='mean', axis=0) | |
| X_train = imputer.fit_transform(X_train) | |
| X_test = imputer.transform(X_test) |
| # The following code fetches the most recent 1000 mentions of 'python'. | |
| from tweepy import Stream | |
| from tweepy import OAuthHandler | |
| from tweepy.streaming import StreamListener | |
| import tweepy | |
| import time | |
| ckey ='x' | |
| csecret = 'x' |
| Service info | |
| sc queryex servicename | |
| Kill service | |
| taskkill /f /pid mypid | |
| System file checker | |
| sfc /scannow | |
| Available physical memory |
| Initialize a new git repository \ | |
| `git init` | |
| Stage files \ | |
| `git add .` | |
| Commit messages \ | |
| `git commit -m <commit message>` | |
| Clone remote repository \ |
| Computer management | |
| compmgmt.msc | |
| Control panel | |
| control | |
| Device manager | |
| devmgmt.msc | |
| Disk cleanup |
| Show tips | |
| Ctrl + . | |
| Peak view | |
| Alt + F12 | |
| Show Solution Explorer | |
| Ctrl + Alt + L | |
| Display quick info |