Uploaded November 2019 | Updated November 2026, 1 hour ago
In this episode of Python Programming Practice, we tackle LeetCode #1 -- Two Sum.
Link to the problem here:
leetcode.com/problems/two-sum
If you don't know Python, you can learn the basics of Python for data analysis using this guide I created on Kaggle (DataDaft video series forthcoming): kaggle.com/hamelg/python-for-data-analysis-index
Python Programming Practice is a series focused on teaching practical coding skills by solving exercises on popular coding websites. Note that the solutions seen here may not be the most efficient possible.
I am not going to provide the full code in the video description for this series, since copy and pasting solutions is not in the spirit of doing coding exercises. It is intended that the video will help you think about problems, approaches and how to structure solutions so that you are able to code up a working solution yourself.
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only
In this episode of Python Programming Practice, we tackle LeetCode #1 -- Two Sum.
Link to the problem here:
leetcode.com/problems/two-sum
If you don't know Python, you can learn the basics of Python for data analysis using this guide I created on Kaggle (DataDaft video series forthcoming): kaggle.com/hamelg/python-for-data-analysis-index
Python Programming Practice is a series focused on teaching practical coding skills by solving exercises on popular coding websites. Note that the solutions seen here may not be the most efficient possible.
I am not going to provide the full code in the video description for this series, since copy and pasting solutions is not in the spirit of doing coding exercises. It is intended that the video will help you think about problems, approaches and how to structure solutions so that you are able to code up a working solution yourself.
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only

![How to Remove a Column From a Data Frame in Pandas (Python)
This video shows 3 ways to remove columns from Data Frames in the Pandas library for Python.
If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: https://www.youtube.com/c/DataDaft?sub_confirmation=1
Code used in this Python Code Clip:
import pandas as pd
import statsmodels.api as sm #(To access mtcars dataset)
mtcars = sm.datasets.get_rdataset(mtcars, datasets, cache=True).data
mtcars.head()
# Delete by column by name
del mtcars[cyl]
mtcars.head()
# Delete columns by name with df.drop()
mtcars = mtcars.drop([hp, carb], # Cols to drop
axis = 1) # 1 for columns
mtcars.head()
# Delete columns by index position with df.drop()
mtcars = mtcars.drop(mtcars.columns[[1,3]], # Index of cols to drop
axis = 1) # 1 for columns
mtcars.head()
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only How to Remove a Column From a Data Frame in Pandas (Python)](https://i.ytimg.com/vi/yRnoP-8zP2I/mqdefault.jpg)


