Flashcards
Lists/Functions - Datacamp intro
Cards in this deck (8)
- 1areas = ["hallway", 11.25, "kitchen", 18.0, "chill zone", 20.0, "bedroom", 10.75, "bathroom", 10.50] Add ["poolhouse", 24.5] to the end of the areas list. Store the resulting list as areas_1areas_1=areas+['poolhouse',24.5]
- 2areas = [11.25, 18.0, 20.0, 10.75, 9.50] Create copy of areas and name it as areas_copyareas_copy = areas[:]
- 3first = [11.25, 18.0, 20.0] Sort this list in descending order using sorted function and name new list first_sortedfirst_sorted=sorted(first,reverse=True)
- 4place = "poolhouse". Print out the number of o's in placeprint(place.count('o'))
- 5areas = [11.25, 18.0, 20.0, 10.75, 9.50] # Print out the index of the element 20.0print(areas.index(20.0))
- 6areas = [11.25, 9.50, 20.0, 10.75, 9.50] # Print out the index of the element 20.0 # Print out how often 9.50 appears in areasprint(areas.count(9.50))
- 7areas = [11.25, 18.0, 20.0, 10.75, 9.50] # Reverse the orders of the elements in areasareas.reverse()
- 8Print out correlation between first and second column of np_baseball np arraynp.corrcoef(np_baseball[:,0],np_baseball[:,1])
Information
- Description
- Easy DS Flashcards on Lists/Functions - Datacamp intro, created by Archimed Nemes on 02/01/2021.
- Created by
- Archimed Nemes
- Views
- 0
- Rating