Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1.  
  2. import numpy as np
  3.  
  4. cars = np.array([["Ford", 25, "oct"],["Fiat", 26, "jan"],["Opel", 30, "feb"],["Ford", 50, "may"]])  #definiuje array
  5.  
  6.  
  7. owned_cars_list = [row[0] for row in cars] # pobieram 1 kolumne
  8.  
  9. owned_cars_list = list(dict.fromkeys(owned_cars_list)) # usuwam duplikaty
  10. owned_cars = np.array( owned_cars_list ) #przerabian ba array aby pozniej dodawac nowe wiersze
  11.  
  12. print(owned_cars)
  13.  
  14. owned_cars[2]= "jaguar1234455"  # chce podmienic wartosc ale miesci sie tylko 4 znaki ???
  15.  
  16. print(owned_cars)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement