r/learnpython • • Nov 26 '23

Which Python is tailored to Artificial Intelligence?

I am planning to pursue a bachelor's degree in Artificial Intelligence, and it requires a solid foundation of python. which specific part of python should I focus on for my journey?

I am planning to pursue a bachelor's degree in Artificial Intelligence, and it requires a solid foundation in Python. which specific part of Python should I focus on for my journey?

0 Upvotes

14 comments sorted by

17

u/JamzTyson Nov 26 '23

a solid foundation of python

That's pretty broad. Off the top of my head:

Basics:

  • Syntax: Understanding Python's syntax, indentation, and basic structure.

  • Variables and Data Types: Knowing different data types (integers, floats, strings, booleans, lists, tuples, dictionaries, sets) and variable assignments.

  • Operators: arithmetic operators, comparison, logical, and bitwise operators.

  • Control Structures: IF/ELIF/ELSE, FOR loops, WHILE loops, Try/EXCEPT.

  • String formatting.

  • Slicing.

Data Structures:

  • Lists, Tuples, Sets, Dictionaries

  • Comprehensions: List comprehensions, dictionary comprehensions, and set comprehensions.

  • Dataclasses, Named Tuples.

Functions and Modules:

  • Functions: Writing functions, parameters, return statements, scope, lambda functions, and higher-order functions.

  • Modules and Packages: Importing modules, creating modules, understanding namespaces, and working with packages from the Python Standard Library.

Object-Oriented Programming (OOP):

  • Classes and Objects: Understanding classes, objects, attributes, methods, encapsulation.

  • Polymorphism, Inheritance, Composition.

  • Special Methods (dunder methods): Knowing about methods like __init__, __str__, __repr__, etc.

File Handling and Input/Output:

  • Reading and Writing Files.

  • Standard Input/Output.

  • Context managers.

Error Handling:

  • Exception Handling using try-except blocks, raising exceptions, handling errors gracefully.

  • Basic debugging.

More Advanced Topics:

  • Decorators and Generators.

  • Multi-Threading, Concurrency, Asynchrony.

  • Regular Expressions.

Data Manipulation Libraries:

  • NumPy, Pandas, SciPy.

Best Practices and Idiomatic Python:

  • Code Organization.

  • PEP-8.

  • Unit Testing.

  • Documentation and Docstrings.

  • Type Hints.

3

u/cesardushime Nov 26 '23

Thank you so much for this detailed outline.

2

u/raharth Nov 26 '23

Python3, numpy, torch, keras tensorflow, matplotlib etc are just libraries. You will need them eventually anyway

2

u/cesardushime Nov 26 '23

Thank you for the detailed recommendation.

21

u/[deleted] Nov 26 '23

Wdym which specific part? It's Python as a whole but ML nowdays needs you to master libraries such as PyTorch, TensorFlow, NumPy, Scickit-Learn, Keras and plotting libraries like Pandas and Matplotlib among others.

3

u/omegasnk Nov 26 '23 edited Nov 17 '25

snails wipe chief rhythm door profit skirt money coherent one

This post was mass deleted and anonymized with Redact

6

u/PaulRudin Nov 26 '23

Numpy, pandas, tensorflow, pytorch...

1

u/Gasp0de Nov 26 '23

Scikit-learn

5

u/ForceBru Nov 26 '23

You should focus on the entirety of Python. No part of Python is specifically tailored towards artificial intelligence, it's a general purpose language. You can write part of a website with it or use it as a scripting language for 3D modeling software, nothing specific to AI/ML.

1

u/[deleted] Nov 26 '23

What degree program at what institution? I already have a degree, but am curious at looking at this curriculm to see what it's all about.

1

u/cesardushime Nov 26 '23

It is Management and Artificial Intelligence.

3

u/RajjSinghh Nov 26 '23

You should start out with basic language features so you can actually write code in python. Get used to just writing code. If you can solve leetcode easy problems you'll be fine.

After that you should get used to the data science ecosystem. Libraries like Numpy, pandas, matplotlib, seaborn and opencv. This is where you do most of your data handling work. 80% of what you will do is data handling.

After that, look into sklearn and then Pytorch or tensorflow. Sklearn has a bunch of classical machine learning tools like linear and logistic regression. Pytorch and tensorflow give you access to neural networks.

2

u/RadioactiveCats_18 Nov 26 '23

Uh...basically ... a snake don't have pahhhts. I guess this would be his...knee?

I'm offended others didn't jump on the gag, but seriously pandas and numpy are good but AI is a comprehensive thing. It's not like data science where with numpy and pandas you're specifically targeting data grids. AI can be analyzing images and then the packages are image related. I guess if I were choosing something essential to programming in AI it would be JSON and REST because accessing data in APIs is exactly how a machine learns. The other "learning" that happens is scraping, so web scraping libraries like Selenium.

1

u/[deleted] Nov 27 '23

I think Indian Python or African Rock Python might be better candidates than let's say Ball Python or Carpet Python. There is also Green Python if you would ever need some business analytics.