Introduction - Intermediate Python Programming p. 1
Skills:
Python for Data50%
Key Takeaways
The video introduces the intermediate Python programming tutorial series, covering topics such as efficiency, maintainability, and modularity, with a focus on standard library, object-oriented programming, and best practices like PEP 8 and the Zen of Python.
Full Transcript
what is going on everybody and welcome to an intermediate Python Programming tutorial series or maybe better called python fundamentals that aren't Basics anymore okay so uh in this tutorial series we're just going to be talking about stuff that I just don't feel like fits anymore in the Python 3 Basics tutorial Series in the past I've just kind of added on to that over time but we're getting to the point where I just don't think it's Basics so first of all like my definition of Basics is at least how I felt when I was doing Basics and that would be like let's just make this work right that was my goal whenever I was first starting out so I just didn't care that much about uh efficiency and scaling and stuff like that I was just trying to learn about the language and make it work now with intermediate Python Programming I kind of break these down and there's kind of like three Hallmarks or trademarks of intermediate Python Programming and that is one it's efficient and it scales well because as you grow a project and if the project is successful it needs to be able to scale otherwise you're going to have to go back and pay off a bunch of what's called technical debt basically uh so you want to be able to scale really well also along those lines the second thing is just maintainability so a lot of this is just readability and how easily we can understand it but also just how well you write your functions and classes and methods and stuff like this that allows you to actually grow over time and improve it because a lot of times you're just going to get to the point where as the project grows and you want to add new things or change things it can become just a huge spiderweb mess nastiness then finally the third thing is just modularity and so the idea here is that when you you make something your goal should be that maybe you want to use this in other projects of your own or maybe other people can make use of the code that you're writing so you want to make something that's extremely gener generalizable uh that should be the goal and that's actually really hard to do and if you're not always thinking about that it's really easy to take the short route and sacrifice modularity but also sacrifice uh maintainability and even efficiency but for the most part scaling and efficiency is more of like a knowledge thing you just need to know how to do it as opposed to maintainability and modularity that's more of like a mindset that you really need to have so one thing I always like to show I've shown this picture a few times before but I think it's a really good one is this kind of comic and the idea is that you know you start with a clean slate and then you build your first project and that's just the simple house and then over time as the project grows you want to add these other little things to it and as time goes on it just gets way out of hand everything's just kind of pieced together there was no thought about I mean obviously I guess this is kind of modular um but it's really difficult for this Pro this kind of kind of project to scale when you're just kind of gluing things together and again it's more of like a mindset when you're writing things especially we're going to be talking um basically this series will start with just some standard library and standard functionality of python that again just isn't basic and then we're going to get into object-oriented programming uh and so as you build let's say uh your classes and stuff like that it's like a it's more of like a mindset when you have to think about okay how could I use this in the future and how can I grow this in the future and so um a good test of that is just to basically have it in a separate file so I'm usually not somebody who's a big fan of making these huge packages but at least the first time you're building uh a class that can actually help out but we'll talk more on that as we go also in terms of maintainability I will just point to pep 8 pep 8 is a style guide it's not Style by for python code it's not it's not dogmatic it's just a it's more of like a suggestion more than anything else if you don't feel very strongly about something use whatever pep eight says or if uh a lot of times you might work in teams like for example Google has their own style guide so if you go to work for Google you're there's some differences between Google's version of styling and pep8 but for the a large part uh people generally follow the same practices and we'll try to adhere uh a decent amount to pep eight but there are certain things I just fundamentally disagree with uh with pep Aon uh just for one quick example will be line length 79 characters just feels unbelievably arbitrary and it encourages you to have like really short or uh like a short function names and short variable names that aren't descriptive aren't readable and also to uh neglect some times having like if especially like when you've got a function and you're actually going to use that function um sometimes it's not clear what that parameter is just by the variables name so you kind of want to have the parameters name equals variable name but if you're trying to not not exceed 79 characters it's really easy oh we'll just chop off the parameter and equals and boom we're good that's that's pep eight that's right right um I don't I disagree with that and there's a few other things in Pepe I just I I just feel like come on guys but anyway um we'll we'll do a lot of things like the naming conventions we're going to follow and stuff like that so pep eight read through it uh it's it's a good read regardless it's something to think about next uh we're going to bring up uh python shell uh let me make it large and probably in my opinion more important than pep8 is the Zen of python you should just always kind of have this in your mind so you can just do import this and this is kind of the the Zen of python um and basically just kind of always be thinking of these things so you know I'm not going to read this all to you but beautiful is better than ugly is one that pretty much everybody violates uh simple is better than complex is one that has unbelievably um complicated ramifications um so maybe we'll show some examples of that flat is better than nested is also usually very complex Andor complicated so a lot of these things are are contradictory in practice practice but um it is something to always kind of think about and try to make your code adhere I would say adhere more to the Zen of python uh at least a line in the Zen of python than pep eight but anyways keep that in mind it's kind of a nice thing to have so uh as this uh tutorial series progresses you can make uh suggestions or recommendations or if I do something that you have a better method of doing it or you think you have something that's more it's going to scale better it's more easily readable and it can scale better because we're going to talk about how scale and readability often come into conflict with each other um but if you've got a better idea or whatever feel free to contribute to the series so uh like I said before the next few videos are just going to be more of kind of built-in things like generators and list comprehension that kind of stuff then we're going to talk a little bit about standard libraries we're going to be talking about multiprocessing and a few others like AR pars and stuff uh and then we'll hop into object-oriented programming uh because objectoriented programming is one of the best ways to make modular code you don't have to use object-oriented programming but it is one of the best ways and it's certainly better than scripting which is most of what we do on the channel so anyways if you have questions comments concerns whatever feel free to leave them below otherwise stay tuned in the next tutorial thanks for watching
Original Description
Welcome to the intermediate Python programming tutorial series. In this series, we're going to be taking the "next steps" after one has become comfortable with the basics of Python, and has been working with it for a bit.
Up to this point, my tutorials have all been done using very basic, rudimentary Python. My definition of basic Python: code that is meant to "just make it run." This is fine for beginners, because there's not much point in overloading with nuances (most people wont retain it, since they don't care, at least I didn't when I was starting out).
I define intermediate Python code as:
Modular - Easily used by others and/or in other projects by you or others. Basically, write code with the intention to honor DRY (don't repeat yourself).
Maintainable - ...Both by the original author and by other users. Is it easily read-able and understood?
Scales - For this to happen, code needs to be efficient when it runs, and be able to scale. Think about reading files, working with requests, or doing calculations. Maintainability also plays a major role in scaling.
In general, code that meets the above standards in Python is done with the Object Oriented Programming (OOP) paradigm. There does exist another paradigm, called Functional Programming (FP), and there are bloody wars fought over which is better. We're going to use OOP. Either one of these is better than outright scripting, which what most beginner programmers are really doing.
To begin this series, I am going to teach a few basic standard library functions and functionalities of Python that will replace otherwise bad habits in programming, before getting into Object Oriented Programming and design.
https://pythonprogramming.net/data-analysis-python-pandas-tutorial-introduction/
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://plus.google.com/+sentdex
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
More on: Python for Data
View skill →
🎓
Tutor Explanation
DeepCamp AI