Skip to content

Instantly share code, notes, and snippets.

@boada
Created July 17, 2015 02:05
Show Gist options
  • Save boada/f41c99cce5dcd05545ed to your computer and use it in GitHub Desktop.
Save boada/f41c99cce5dcd05545ed to your computer and use it in GitHub Desktop.
import numpy as np
data = np.loadtxt('testfile, delimiter=',')
data = np.loadtxt('testfile', delimiter=',')
data = np.genfromtxt('testfile', delimiter=',')
data
x = -np.ones(6)
x
bad = np.isnan(data)
bad
x[~bad] = data[~bad]
x
bad
~bad
x = -np.ones(6,(10))
x = -np.ones(6,10)
x = -np.ones((6,10))
x
x = -np.ones((10,6))
x
x[~bad][3] = data[~bad]
x[3][~bad] = data[~bad]
x
history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment