Skip to content

Instantly share code, notes, and snippets.

View bukson's full-sized avatar

Michał Bukowski bukson

View GitHub Profile
@bukson
bukson / nancorrmp_correlation.py
Created February 4, 2020 12:45
Calculating correlation for data with NaN using multiple cores
import pandas as pd
import numpy as np
from nancorrmp.nancorrmp import NaNCorrMp
dataset = pd.DataFrame([
[2, 3000, 0, 0],
[10, 0, 100, float('inf')],
[1, 0, -1150, float('-inf')],
[1, 0, 0, float('NaN')],
@bukson
bukson / numpy_correlation_nan.py
Last active February 4, 2020 12:43
Comparison of numpy corrcoef with pandas corr when data has NaN
import pandas as pd
import numpy as np
dataset = pd.DataFrame([
[2, 3000, 0, 0],
[10, 0, 100, float('inf')],
[1, 0, -1150, float('-inf')],
[1, 0, 0, float('NaN')],
[4, 4000, -800, -0.2]
])
@bukson
bukson / numpy_correlation.py
Created February 4, 2020 12:34
Simple numpy correlation calculation
import pandas as pd
import numpy as np
dataset = pd.DataFrame([
[2, 3000, 0],
[10, 0, 100],
[1, 0, -1150],
[1, 0, 0],
[4, 4000, -800]
])

Keybase proof

I hereby claim:

  • I am bukson on github.
  • I am bukson (https://keybase.io/bukson) on keybase.
  • I have a public key ASA01SjCx8A-DrikdxkX4WaKIss2c6Bw7z8JgUwybaGNxwo

To claim this, I am signing this object: