Skip to content

Instantly share code, notes, and snippets.

View krzysztof-slowinski's full-sized avatar

Krzysztof Słowiński krzysztof-slowinski

View GitHub Profile
@krzysztof-slowinski
krzysztof-slowinski / hash_map.py
Created August 23, 2018 07:14
Example HashMap using Python
class Node:
def __init__(self, value):
self.value = value
self.next_node = None
def get_value(self):
return self.value
def get_next_node(self):
return self.next_node
@krzysztof-slowinski
krzysztof-slowinski / sftp_sync.py
Last active January 25, 2023 05:43
Pysftp - get only the changed files from the remote directory
import os
import configparser as cp
import shutil
import pysftp
import paramiko
from paramiko.py3compat import decodebytes
# credentials file name
CREDENTIALS_FILE = 'sftp_sync_credentials.properties'
@krzysztof-slowinski
krzysztof-slowinski / shift.py
Last active March 2, 2018 16:39
Creating a new column based on index shifts of existing column and interpolated missing values (https://stackoverflow.com/questions/48563101/creating-a-new-column-based-on-index-shifts-of-existing-column-and-interpolated)
import pandas as pd
import numpy as np
def create_shift(df, column, shift_value, method, name):
"""
Create a new column based on an existing column with a given shift value. The shifted column is indexed based on an
existing index with he missing values interpolated using the given method.
:param df: DataFrame to create the shift in.