r/pythontips • • Aug 26 '19

Python Data Analysis | Data Science Tutorials 4-6

27 Upvotes

Python Data Analysis | Data Science Tutorials #4| Descriptive Statistics

https://www.youtube.com/watch?v=1JzLqyymA1g&t=1s

Python Data Analysis | Data Science Tutorials #5 Adding Columns to Dataframe

https://www.youtube.com/watch?v=Bn_92OVW8jw&t=8s

Python Data Analysis | Data Science Tutorials #6 NAN Null Values

https://www.youtube.com/watch?v=AAfwMEvYLA4


r/pythontips • • Jun 04 '19

Python Tutorials: If __name__ == "__main__" (video):

27 Upvotes

r/pythontips • • Apr 09 '19

Guide: Pandas DataFrames for Data Analysis

27 Upvotes

The core data structure in Pandas is a DataFrame. A DataFrame is a two-dimensional data structure made up of columns and rows.

The Pandas DataFrame structure gives you the speed of low-level languages combined with the ease and expressiveness of high-level languages.

Each row in a DataFrame makes up an individual record—think of a user for a SaaS application or the summary of a single day of stock transactions for a particular stock symbol.

Each column in a DataFrame represents an observed value for each row in the DataFrame. DataFrames can have multiple columns, each of which has a defined type.

Read more here!


r/pythontips • • Mar 19 '19

Three common mistakes beginner Python programmers make (video)

27 Upvotes

r/pythontips • • Jan 16 '19

HOW I FOUND MY APARTMENT: PYTHON-STYLE

27 Upvotes

Check out my new post about how using selenium and python to find apartments on Facebook

https://dapythonista.com/2019/01/14/how-i-found-my-apartment-python-style/


r/pythontips • • Dec 30 '18

Module Send Emails using Python SMTPLib

27 Upvotes

Hey Everyone!

SmtpLib Module is a useful library in python to send emails.

Why would you use this?

  1. Monitor your scripts remotely

  2. Notify/Alert you about error messages

  3. Send attachments

  4. If you want to send a mail to a lot of people

Tutorial: https://youtu.be/URhubJZMqvQ


r/pythontips • • Aug 01 '18

Python 3 Tutorials for Beginners - Tuples, Set & Dictionaries

27 Upvotes

Learn all about Python 3 Tuples, Set & Dictionaries. Absolute beginners guide ...

https://youtu.be/DtaxcHAEpqs


r/pythontips • • Jun 03 '16

Syntax Replace chained conditionals with dict

27 Upvotes

Python has no case statement, and it sometimes leads to long ugly lists of conditionals, like so:

if myvar == 'a':
    do_a()
elif myvar == 'b':
    do_b()
elif myvar == 'c':
    do_c()

Instead of long lists of conditionals, you can build a simple dictionary of the options and outputs and just pass the parameter you're switching on into the dictionary:

output_dict = {'a': do_a,
               'b': do_b,
               'c': do_c}
output_dict[myvar]()

If you need an else, statement, instead of this:

    if myvar == 'a':
        do_a()
    elif myvar == 'b':
        do_b()
    elif myvar == 'c':
        do_c()
    else:
        do_else()

you can pass your default into a getattr call, like this:

output_dict = {'a': do_a,
               'b': do_b,
               'c': do_c}
output_dict.get(myvar, do_else)()

Easier to read, more pythonic


r/pythontips • • Oct 07 '25

Syntax Made a VS Code hover extension that pulls live Python docs (helped me learn a ton)

26 Upvotes

Hey folks I built a little VS Code extension that shows Python documentation when you hover over stuff, but it goes a bit further than usual:

Instead of just static docstrings, it pulls live documentation from Intersphinx mappings (like ReadTheDocs projects). That means it updates automatically when the docs do so you always get the latest info right in your editor.

I originally made it for myself because I was tired of switching between tabs every time I wanted to remember what a function did. Ended up getting kind of addicted to just hovering around code and passively learning things I didn’t know I needed. It’s genuinely made me a better Python dev without even trying that hard.

If it sounds useful to you, feel free to check it out or drop feedback.
🛠️ Marketplace: https://marketplace.visualstudio.com/items?itemName=KiidxAtlas.python-hover


r/pythontips • • Feb 25 '25

Module How I Built a Crazy Fast Image Similarity Search Tool with Python

26 Upvotes

Hey folks! So, I recently dove into a fun little project that I’m pretty excited to share with you all. Imagine this: you’ve got a massive folder of images—think thousands of pics—and you need to find ones that look similar to a specific photo. Sounds like a headache, right? Well, I rolled up my sleeves and built a tool that does exactly that, and it’s lightning fast thanks to some cool tech like vector search and a sprinkle of natural language processing (NLP) vibes. Let me walk you through it in a way that won’t bore you to death.

checkout the article

https://frontbackgeek.com/how-i-built-a-crazy-fast-image-similarity-search-tool-with-python/


r/pythontips • • Apr 08 '23

Short_Video Top 10 Common Mistakes Python Programmers Make and How to Avoid Them

26 Upvotes

Hey everyone,

Today, I want to discuss some common mistakes that Python programmers, especially beginners, often make. Even if you're an experienced developer, it's always good to have a refresher on potential pitfalls. Let's dive in!

post link


r/pythontips • • Oct 27 '22

Short_Video How to check for None and avoid potential bugs

26 Upvotes

You should use is None when checking if a variable is None.

if variable is None:
    print("Found NoneType!")

Here's a full video explaining the pitfalls of if variable: when checking for None: https://youtu.be/z99Nwb3vPfE


r/pythontips • • Jul 26 '22

Module LovelyPlots

26 Upvotes

Tired of setting @matplotlib label sizes, not being able to modify your figure texts in Adobe Illustrator, and having to change your figure fonts to match the one of your tex document? Give LovelyPlots a try!

https://github.com/killiansheriff/LovelyPlots


r/pythontips • • Jul 26 '22

Module 100DaysOfCode

26 Upvotes

Hello to everybody,

Right now I am working as SAP MM/SD Consultant, but I always had interest in learning coding and data engineering. I started the 100DaysOfCode course and finished 15th day yesterday. I had no prior experience in coding. Right now I can do beginner projects like Blackjack, Coffee Machine all by myself. Beside my current job and learning this course, I have some spare time to work on something else. I would like to ask your recommendations regarded to what can I learn at the same time to improve myself in data subject or any other tips on this road.

Thanks in advance.


r/pythontips • • Mar 17 '22

Module New to Python. Looking for legibility tips.

26 Upvotes

Hey guys! I’m following a course right now and some of my friends are saying it isn’t exactly how you would “write code”. The lessons are based more so on problem solving, which I enjoy tbh.

To the chase, I made a Rock, Paper, Scissor game and this was my code:

import random

cinput = random.randint (0, 2)

question = input("What do you choose? Type 0 for Rock, 1 for Paper, or 2 for Scissors\n")

if int (question) == 0: print (rock)

print("The Computer Chose:")

if cinput==1: print (paper) print ("You Lose") elif cinput == 2: print (scissors) print("You win!") else: print (rock) print ("Darn, it's a tie! Try again.")

I repeated this for all 3 outcomes and looked back at my “professor’s” code and it was a lot more simplified.

Is it common to overkill code in the beginning? And how did you guys learn to code simpler? Any tips would be appreciated. Please be kind, I’m still enthusiastic about learning 😅


r/pythontips • • Feb 23 '22

Module How do I catch an error during a for loop

26 Upvotes

Hey guys,

so im currently working on a little game in python (as my first project). In the function game() there is a for loop for placing your ships (im programming battleships). I want to incorporate an if clause, that repeats the loop at the same spot if that condition is met. For example the loop needs to complete five times in order to finish. If the clause is met (the clause = error catcher) during the third time, I want it it to start over on the third time.

My code:https://imgur.com/a/h7nC7cg

for clearance: sf = 3 Dimensional array (playing board)

schiffe_name = 2D array that stores the names of the 5 ships

Hope you guys can help me on this one


r/pythontips • • Nov 14 '21

Python3_Specific Convert PDF to DOCX using Python

26 Upvotes

Learn how to convert PDF to docx and vice versa in a few lines of code using Python:
https://pyshark.com/convert-pdf-to-docx-and-docx-to-pdf-using-python/


r/pythontips • • Nov 03 '21

Meta How can I go back to coding?

26 Upvotes

I stopped coding around 2 months ago. I learned the basics of python and according to the course, which was on Udemy, I just finished the beginner section. Since then, I stopped coding due to school (I'm in 11th grade/ a junior?) I would really love to start coding again, but I don't know where to begin, so I've been delaying it for weeks now. Watching all the videos and doing all the exercises again will take me about 20 hours. I would love it if anyone could help me as I really want to start coding again :)


r/pythontips • • Sep 16 '21

Python3_Specific Just started OOP learning in Python, any help?

26 Upvotes

I'm quiet new to python, also it's my first language and I was playing around with classes and such and came up with a program that prints out some car detailsMy question is how to use the __add__ method to sum up more than 2 elements? Is it possible?

here is my code: https://imgur.com/a/HcSqArM

if I print(car1 + car2) it will print all details from both instancesbut how can I print all details for ALL four cars? how to use print(car1 + car2 + car3 + car4) to make it work ?

yes, I know I can just print(car1 + car2) and under it print(car3 + car4)but that would defeat the purpose of what I'm trying to understand :D

also print(str(car1 + car2) + '\n' + str(car3 + car4)) works too but not what I want


r/pythontips • • Jul 27 '21

Long_video Who wants to learn python programming?

26 Upvotes

Learn python programming

7 lists

https://youtu.be/VUsZrPHQNt4

8 sets

https://youtu.be/hpfnvV74rIQ

9 tuples :fast and Read only

https://youtu.be/r5BCdPA0oBI


r/pythontips • • Jan 02 '21

Module Trading program

26 Upvotes

Hi, I currently trade stocks using signals given to me by my friend in discord, I was wondering if there was a way I could program something so the information could be copied from the discord and pasted into my broker? There would also be a slight translation. As the dates he writes out are written like 1/15 whereas my trading program only recognised them as January the 15th? Any help would be massively appreciated thanks!


r/pythontips • • Sep 30 '20

Data_Science How to extract certain data from a Word document and enter into an Excel spreadsheet using Python.

26 Upvotes

I was given a number of word documents, each containing some information about candidates which were interviewed for a certain job. I have to put certain data about each candidate from these Word docs into an Excel spreadsheet(Name, Interview date, Interview Results, Job title, etc). The total number of Word docs is low enough to where I can manually find the specific pieces of data that I need in each doc, and enter it into the spreadsheet on my own. However, I'm curious as to how I would go about creating a Python program to iterate through the word document(s) and find the specific things I'm looking for, and then in the end put those values into a spreadsheet. I've done something similar, however the file I was pulling data from was a CSV file, so it was much easier to figure out. The word docs a fair amount of filler text which I don't need, so I'm struggling to think of how to do so with the given file format. Any advice would be greatly appreciated!


r/pythontips • • Oct 10 '19

Adding Python Autocomplete for Vim

26 Upvotes

Video showing you how to add Python completions to Vim using a free plugin called Kite.

Watch on YouTube


r/pythontips • • Sep 12 '19

My explanation of Object Oriented Programming

26 Upvotes

I have started a series on OOPS. My objective was to explain the concept like we are 5. So here is my understanding and explanation of OOPS. All comments are appreciated !! https://youtu.be/fe9h17PYn0M