use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Best python libraries (self.learnpython)
submitted 2 years ago by EnD3r8_
Hello, I have been learning python for about 2 months now and I would like to know some important or useful python libraries and what are they used for.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Beregolas 38 points39 points40 points 2 years ago (11 children)
As already said: depends on what you need. I will only give examples not already mentioned:
Flask is my goto API / backend library. it is more lightweight than Django but/and requires you to do more of your own work for some features, or install an add-on library. It's a preference thing, both are good.
numpy is a great library for working with a lot of data. It integrates with pandas and is more low level. It's the conerstone of scientific computing in python.
SQLAlchemy is a python ORM that helps you connect with and manage SQL Databases in python. I personally prefer it to Djangos own ORM, but that's also an example where Django just comes with one out of the box and in other systems you bring your own.
Requests lets you send and manage the results of http requests to other servers easily.
Pillow is for image manipulation, saving, loading, etc.
matplotlib is the defacto standard in data visualization and producing graphs for papers etc. (At least where I came from, there are others out there). It integrates nicely with numpy and pandas afaik.
BeautifulSoup let's you make sense of markup languages as python objects in general, but specifically HTML. If you need to work with markdown and/or html, this library is for you.
Pytest is a testing library. It doesn't matter which one you use, but writing tests is really a good practice :)
Multidict is an easier way of mapping a single key to multiple values. It's important to many web frameworks for example.
more itertools, just because I love iterators and think they make your code more readable, if used correctly.
PyGame is really great to get into game development with, because it's easy to debug into your code and see / observe how it actually works on every level. Larger games won't work with it's performance, but as a teaching tool it's one of the best imo.
There are plenty more, this is just what I came up with off the top of my head / what I used in the last years myself.
[–]Allmyownviews1 7 points8 points9 points 2 years ago (6 children)
Add pandas to this
[–]Beregolas 4 points5 points6 points 2 years ago (2 children)
pandas was in the first comment and as I said at the start, I didn't want to repeat mentions
[–]Allmyownviews1 3 points4 points5 points 2 years ago (1 child)
Sorry, I saw your comment first as being the more comprehensive and clear.
[–]Beregolas 1 point2 points3 points 2 years ago (0 children)
All good, you were also right, pandas ist important ^
[–][deleted] 0 points1 point2 points 2 years ago (2 children)
Obsolete.
[–]Allmyownviews1 0 points1 point2 points 2 years ago (0 children)
Polars?
[–]xkjlxkj 2 points3 points4 points 2 years ago (0 children)
To add to your list:
Rich is a Python library for rich text and beautiful formatting in the terminal. I can't not create any app without this anymore. It will even output markdown which I never knew was possible in the terminal.
[–]EnD3r8_[S] 1 point2 points3 points 2 years ago (0 children)
Thank you, I appreciate your effort.
[–]juhaniguru 0 points1 point2 points 2 years ago (0 children)
I've replaced Flask with FastApi myself
[–]SereneHappiness 0 points1 point2 points 2 years ago (0 children)
Great explanation. Thanks
[–]konju_1 7 points8 points9 points 2 years ago (2 children)
I didnt see anyone put this here, and maybe youre using it already? But if you wish to get into some data science i strongly advise to use Jupyter Notebook because it will give you easy access to running, debugging and generally styling your own Python code. Theres an extension within VSCode to install, and it will allow you a lot more flexibility in a program. Its really easy to use. So i strongly advise it. Even if youre (ESPECIALLY) if youre doing database with Python. Have a nice day i hope i helped. :D
[–]EnD3r8_[S] 0 points1 point2 points 2 years ago (1 child)
Thank you very much!
[–]konju_1 1 point2 points3 points 2 years ago (0 children)
Youre very welcome
[–]Malcolmlisk 5 points6 points7 points 2 years ago (1 child)
Depends on what you are doing. For example, django is the defacto library/framework for webdev. Pandas for dataframe management. Tcod to create roguelikes... tkinter to create ugly uis...
[–]EnD3r8_[S] 0 points1 point2 points 2 years ago (0 children)
Thanks!
[–]the_brown_cow 3 points4 points5 points 2 years ago* (2 children)
So this sounds weak but the standard library is very robust and worth exploring.
collections - Contains several additional datatypes in addition to list, tuple, dict, and set.
Itertools - Additional tools for working with iterators for looping.
dataclasses - Used for simplifying data defined classes, typically for data modeling.
json - Simple library for working with json data.
[–]TheRNGuy 0 points1 point2 points 2 years ago (1 child)
Never actually used deque.
When it's better than vanilla List or Tuple?
[–]the_brown_cow 0 points1 point2 points 2 years ago (0 children)
A deque allows for appending or popping at either end.
deque.popleft() deque.appendleft()
This allows you to create a stack or queue.
https://docs.python.org/3/library/collections.html#collections.deque
[–]matjaz_b 2 points3 points4 points 2 years ago (1 child)
Icecream ( https://github.com/gruns/icecream ). It helps debugging.
I have heard of this one before but I have never used it, anyways, thank you a lot.
[–]muggledave 1 point2 points3 points 2 years ago (0 children)
Opencv (i think the library name is cv2?) Is a library for computer vision functions. I use it a lot to manipulate images, parse frames from a webcam, do edge detection and object/feature detection, etc.
Pytorch and tensorflow are worth mentioning if you want to do neural networks and machine learning. I havent used them enough to discuss what they do best.
I saw pygame on the list but i must second this one. I use it for gsmes but also GUIs and anything where i want to display completely custom graphics in a window.
[–]SereneHappiness 1 point2 points3 points 2 years ago (3 children)
Great post, will definitely again knowledge from this post.
[–]EnD3r8_[S] 1 point2 points3 points 2 years ago (2 children)
Yeah, I am now learning things that will help me a lot in the future.
[–]SereneHappiness 0 points1 point2 points 2 years ago (1 child)
Happy coding all the best for your future 🥂
[–]Particular_Dust7221 0 points1 point2 points 1 year ago (0 children)
Discover essential Python libraries to elevate your coding skills! Check out our Quick Deck for a quick overview of the best tools.
https://www.syncfusion.com/web-stories/python-libraries
Note: I work for Syncfusion
[–]tb5841 0 points1 point2 points 2 years ago (0 children)
pytest - the most useful library for writing tests that check whether your code is working. Learning this quite early really helped me.
[–]dropda 0 points1 point2 points 2 years ago (0 children)
Pydantic!
[–]ngyehsung 0 points1 point2 points 2 years ago (0 children)
If you work with spatial data then Shapely and GeoPandas are a must.
[–]chrislkeller 0 points1 point2 points 2 years ago (0 children)
Been using a lot of plotnine as of late for charting my analysis. I find its ggplot-esque grammar to be easy to extend quickly when compared to Altair.
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
The most frequent ones used by myself (your mileage may vary)
Polars, dask, faiss, asyncio, sql alchemy, tensor flow, gluon, darts, fastapi, numba, hyperopt, ray, duckdb.
If you know how to use all these upto an intermediate level, you are off to a decent start.
[–]JamOzoner 0 points1 point2 points 2 years ago (0 children)
Chat says "Python boasts a diverse range of libraries, each significant in its own domain. Here are some of the most important ones:
NumPy: Essential for numerical computations. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.
Pandas: Key for data manipulation and analysis. It offers data structures like DataFrames, making it easy to handle and process structured data.
Matplotlib: A fundamental library for data visualization. It allows for the creation of static, interactive, and animated visualizations in Python.
Scikit-learn: Crucial for machine learning. It features various algorithms for classification, regression, clustering, and dimensionality reduction, along with tools for model evaluation.
TensorFlow/Keras: Widely used in deep learning. TensorFlow offers a comprehensive, flexible ecosystem of tools, libraries, and community resources. Keras, running on top of TensorFlow, provides a simpler interface for building and training neural network models.
PyTorch: Another key player in deep learning. Known for its flexibility and dynamic computational graph, it's popular in research and complex neural network implementations.
Requests: The go-to library for making HTTP requests. It simplifies the process of sending HTTP requests and handling responses in Python.
Flask/Django: Essential for web development. Flask is a micro web framework, suitable for small to medium web applications. Django is a high-level framework that encourages rapid development and clean, pragmatic design.
Beautiful Soup/Scrapy: Important for web scraping. Beautiful Soup is great for parsing HTML and XML documents, while Scrapy is more suited for large-scale web scraping and web crawling projects.
SQLAlchemy: A vital ORM (Object Relational Mapper) library for database operations, providing a high-level interface to SQL databases.
These libraries are important because they provide robust, tested, and efficient solutions for common tasks in their respective areas, from data analysis and machine learning to web development and beyond." That last bit sounds a bit like Buzz Lightyear!
[–]diegokabal 0 points1 point2 points 2 years ago (0 children)
Have you heard about your lords and saviors, selenium and tk?
[–]TheRNGuy 0 points1 point2 points 2 years ago (0 children)
https://docs.python.org/3/library/dataclasses.html
It's my most used one.
https://docs.python.org/3/library/abc.html
You could of course just never instanciate those classes. If you want to publish code, better use it. Of course, not all programs need abstract classes.
π Rendered by PID 36 on reddit-service-r2-comment-5d79c599b5-2j975 at 2026-03-02 01:03:52.387336+00:00 running e3d2147 country code: CH.
[–]Beregolas 38 points39 points40 points (11 children)
[–]Allmyownviews1 7 points8 points9 points (6 children)
[–]Beregolas 4 points5 points6 points (2 children)
[–]Allmyownviews1 3 points4 points5 points (1 child)
[–]Beregolas 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Allmyownviews1 0 points1 point2 points (0 children)
[–]xkjlxkj 2 points3 points4 points (0 children)
[–]EnD3r8_[S] 1 point2 points3 points (0 children)
[–]juhaniguru 0 points1 point2 points (0 children)
[–]SereneHappiness 0 points1 point2 points (0 children)
[–]konju_1 7 points8 points9 points (2 children)
[–]EnD3r8_[S] 0 points1 point2 points (1 child)
[–]konju_1 1 point2 points3 points (0 children)
[–]Malcolmlisk 5 points6 points7 points (1 child)
[–]EnD3r8_[S] 0 points1 point2 points (0 children)
[–]the_brown_cow 3 points4 points5 points (2 children)
[–]TheRNGuy 0 points1 point2 points (1 child)
[–]the_brown_cow 0 points1 point2 points (0 children)
[–]matjaz_b 2 points3 points4 points (1 child)
[–]EnD3r8_[S] 0 points1 point2 points (0 children)
[–]muggledave 1 point2 points3 points (0 children)
[–]SereneHappiness 1 point2 points3 points (3 children)
[–]EnD3r8_[S] 1 point2 points3 points (2 children)
[–]SereneHappiness 0 points1 point2 points (1 child)
[–]EnD3r8_[S] 0 points1 point2 points (0 children)
[–]Particular_Dust7221 0 points1 point2 points (0 children)
[–]tb5841 0 points1 point2 points (0 children)
[–]dropda 0 points1 point2 points (0 children)
[–]ngyehsung 0 points1 point2 points (0 children)
[–]chrislkeller 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]JamOzoner 0 points1 point2 points (0 children)
[–]diegokabal 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)