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 pandas as pd | |
| df1 = pd.DataFrame(data=[1, 2, 3, 4], index=pd.Index([1, 2, 3, 4])) | |
| df2 = pd.DataFrame(data=[3, 4, 5, 6], index=pd.Index([3, 4, 5, 6])) | |
| df1_only_rows_with_index_in_df2 = df1[df1.index.isin(df2.index)] |
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 numpy | |
| import random | |
| import time | |
| from keras.models import Sequential | |
| from keras.layers import Dense | |
| def run(): | |
| """ Runs 500 Sequential networks on a random train/test set. Slows down after each nn iteration """ | |
| num_input_nodes = 12 |
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
| \usepackage{listings} | |
| \begin{lstlisting}[language=Python, caption=Caption below code, captionpos=b] | |
| # The ugliest python code in history to show nesting etc | |
| def function_name(p1, p2): | |
| some_var = 0 | |
| for i in range(len(p1)): | |
| some_var += p2[i] | |