Python Basics # 4 | List Operations | append | extend | sort | remove | delete | slicing in python

preview_player
Показать описание
Python Basics # 4 | List Operations | append | extend | sort | remove | delete | slicing in python

Python List Operations

Python Basics - Session No 4

Topic to be covered - List in Python

Code Starts Here
==============

list1 = [1,2,3,4,'Hi','Hello','Bye',3.14,33.6,True]

list1 = [1,2,3,4,'Hi','Hello','Bye',3.14,33.6,True,[4,5,6]]

How to reference a List
list1[6]

list1[-1][0]

Slicing in Python List
list [ number : n - 1]

list1[ 3 : 8 ]
list1[ 3 : 7 ]

How to get the index of a partticular element

Count the items
len(list1)

tuple1 = (1,2,3,4)

list2 = [1,2,3,4,'Hi','Hello','Bye',3.14,33.6,True,[4,5,6],(1,2,3,4)]

lista = [1,2,3]
listb = ['a','b','c']

listc = [1,2,3]
listd = ['a','b','c']

listc = lista + listb

print(listc)

Change the list

listc[4] = 'x'

Difference between Append and Extend in List

print(lista)

print(listc)

Delete operations in List

del listc[1]

Aliasing in Python

x = ['A','B','C']
y = x

z = x[:]

lists = [8,7,5,4,3,2,10,0,1]

list_string=['Venkat','Maneesh','Majid','Shwetha','Sonali','Mohsin']
print(list_string)

All the playlist of this youtube channel
========================================

1. Data Preprocessing in Machine Learning

2. Confusion Matrix in Machine Learning, ML, AI

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz

4. Cross Validation, Sampling, train test split in Machine Learning

5. Drop and Delete Operations in Python Pandas

6. Matrices and Vectors with python

7. Detect Outliers in Machine Learning

8. TimeSeries preprocessing in Machine Learning

9. Handling Missing Values in Machine Learning

10. Dummy Encoding Encoding in Machine Learning

11. Data Visualisation with Python, Seaborn, Matplotlib

12. Feature Scaling in Machine Learning

13. Python 3 basics for Beginner

14. Statistics with Python

15. Data Preprocessing in Machine Learning

16. Sklearn Scikit Learn Machine Learning

17. Linear Regression, Supervised Machine Learning
Рекомендации по теме