Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Created on Tue Oct 15 08:21:46 2019
- @author: student
- """
- #def funkcija():
- # print("hello")
- #
- #funkcija()
- import numpy as np
- #def kvadriranje(x):
- # return x**2
- #
- #def potenciranje(x, y=2):
- # return x**y
- #
- #a = kvadriranje(5)
- #b = kvadriranje(150)
- #
- #l = np.linspace(10, 30, 100)
- #
- #l_kvadrirano = kvadriranje(l)
- #
- #x = potenciranje(2, 3)
- import matplotlib.pyplot as plt
- #x = np.array([5,10])
- #y = np.array([5,10])
- #
- #plt.plot(x, y, 'go-')
- #x = np.linspace(0, 10, 1000)
- #y = np.sin(x)
- #
- ##plt.figure()
- ##plt.plot(x, y,'y.')
- ##plt.title("Graf")
- ##plt.xlabel("xos")
- ##plt.ylabel("y-os")
- ##plt.axhline(4, color = "red")
- ##plt.axis("equal")
- ##plt.xlim(1, 5)
- ##plt.ylim(-2,2)
- ##plt.grid()
- ##plt.savefig("plot")
- ##
- #def kvadriranje(x):
- # return x**2
- ##
- #y2 = kvadriranje(x)
- ##plt.figure()
- ##plt.plot(x, y2, "r.")
- #
- #figure = plt.figure(constrained_layout = True)
- #
- #grid = figure.add_gridspec(3, 5)
- #
- #ax1 = figure.add_subplot(grid[0, :])
- #ax2 = figure.add_subplot(grid[1:, :-2])
- #ax3 = figure.add_subplot(grid[2, -2:])
- #
- #ax1.plot(x, y, "r.-")
- #ax2.plot(x, y2, "b-")
- M = np.loadtxt("datoteka.txt", comments="$", delimiter = ", ")
- M[3, :] = 140
- M[:, 1] = 123
- np.savetxt("novadar.txt", M, delimiter="\t", )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement