Skip to content

Instantly share code, notes, and snippets.

@cavaunpeu
Created July 18, 2017 17:11
Show Gist options
  • Save cavaunpeu/028f0f587fa1169360dfe697d9182875 to your computer and use it in GitHub Desktop.
Save cavaunpeu/028f0f587fa1169360dfe697d9182875 to your computer and use it in GitHub Desktop.
x = np.linspace(0, 100, 1)
def transformation(my_x):
results = []
for x in my_x:
if x > 10:
results.append( x**2 )
else:
results.append( x**3 )
return results
y = transformation(x)
plt.plot(x, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment