Skip to content

Instantly share code, notes, and snippets.

View ryancollingwood's full-sized avatar
🙌
Grateful for the codes

Ryan Collingwood ryancollingwood

🙌
Grateful for the codes
View GitHub Profile
@ryancollingwood
ryancollingwood / compare_dfs.py
Last active September 11, 2018 02:11 — forked from yassineAlouini/compare_dfs.py
Compare two Pandas DataFrames
import pandas as pd
import numpy as np
def compare_two_dfs(input_df_1, input_df_2):
# explicitly calling fillna with ""
# as if you've used np.nan it has the
# property of nevery being able to be equals
# i.e. `np.nan == np.nan` will always be False
df_1, df_2 = input_df_1.copy().fillna(""), input_df_2.copy().fillna("")
# Credit for this: Nicholas Swift
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
from warnings import warn
import heapq
class Node:
"""
A node class for A* Pathfinding
"""