16. upper()
As the name implies, the upper() method converts string characters into their uppercase equivalent:
As the name implies, the upper() method converts string characters into their uppercase equivalent:
y = "Python tutorial"Output: PYTHON TUTORIAL
y = y.upper()
print(y)
👍2❤1
17. lower()
You guessed right! Python's lower() is the opposite of upper(). So it converts string characters to lowercases:
You guessed right! Python's lower() is the opposite of upper(). So it converts string characters to lowercases:
y = "PYTHON TUTORIAL"Output: python tutorial
y = y.lower()
print(y)
👍2
18. sorted()
The sorted() function works by making a list from an iterable and then arranging its values in descending or ascending order:
[9, 4, 3, 1]
[3, 5, 8, 9]
The sorted() function works by making a list from an iterable and then arranging its values in descending or ascending order:
f = {1, 4, 9, 3} # Try it on a set
sort = {"G":8, "A":5, "B":9, "F":3} # Try it on a dictionary
print(sorted(f, reverse=True)) # Descending
print(sorted(sort.values())) # Ascending (default)
Output: [9, 4, 3, 1]
[3, 5, 8, 9]
19. join()
The join() function lets you merge string items in a list.
You only need to specify a delimiter and the target list to use it:
The join() function lets you merge string items in a list.
You only need to specify a delimiter and the target list to use it:
a = ["Python", "tutorial", "on", "MUO"]Output: Python tutorial on MUO
a = " ".join(a)
print(a)
👍4❤1
20. replace()
Python's replace() method lets you replace some parts of a string with another character. It's often handy in data science, especially during data cleaning.
The replace() method accepts two parameters: the replaced character and the one you'll like to replace it with.
Here's how it works:
Cart name
First name
Last name
Python's replace() method lets you replace some parts of a string with another character. It's often handy in data science, especially during data cleaning.
The replace() method accepts two parameters: the replaced character and the one you'll like to replace it with.
Here's how it works:
columns = ["Cart_name", "First_name", "Last_name"]Output:
for i in columns:
i = i.replace("_", " ")
print(i)
Cart name
First name
Last name
👍8❤1
Learning Python for data science can be a rewarding experience. Here are some steps you can follow to get started:
1. Learn the Basics of Python: Start by learning the basics of Python programming language such as syntax, data types, functions, loops, and conditional statements. There are many online resources available for free to learn Python.
2. Understand Data Structures and Libraries: Familiarize yourself with data structures like lists, dictionaries, tuples, and sets. Also, learn about popular Python libraries used in data science such as NumPy, Pandas, Matplotlib, and Scikit-learn.
3. Practice with Projects: Start working on small data science projects to apply your knowledge. You can find datasets online to practice your skills and build your portfolio.
4. Take Online Courses: Enroll in online courses specifically tailored for learning Python for data science. Websites like Coursera, Udemy, and DataCamp offer courses on Python programming for data science.
5. Join Data Science Communities: Join online communities and forums like Stack Overflow, Reddit, or Kaggle to connect with other data science enthusiasts and get help with any questions you may have.
6. Read Books: There are many great books available on Python for data science that can help you deepen your understanding of the subject. Some popular books include "Python for Data Analysis" by Wes McKinney and "Data Science from Scratch" by Joel Grus.
7. Practice Regularly: Practice is key to mastering any skill. Make sure to practice regularly and work on real-world data science problems to improve your skills.
Remember that learning Python for data science is a continuous process, so be patient and persistent in your efforts. Good luck!
1. Learn the Basics of Python: Start by learning the basics of Python programming language such as syntax, data types, functions, loops, and conditional statements. There are many online resources available for free to learn Python.
2. Understand Data Structures and Libraries: Familiarize yourself with data structures like lists, dictionaries, tuples, and sets. Also, learn about popular Python libraries used in data science such as NumPy, Pandas, Matplotlib, and Scikit-learn.
3. Practice with Projects: Start working on small data science projects to apply your knowledge. You can find datasets online to practice your skills and build your portfolio.
4. Take Online Courses: Enroll in online courses specifically tailored for learning Python for data science. Websites like Coursera, Udemy, and DataCamp offer courses on Python programming for data science.
5. Join Data Science Communities: Join online communities and forums like Stack Overflow, Reddit, or Kaggle to connect with other data science enthusiasts and get help with any questions you may have.
6. Read Books: There are many great books available on Python for data science that can help you deepen your understanding of the subject. Some popular books include "Python for Data Analysis" by Wes McKinney and "Data Science from Scratch" by Joel Grus.
7. Practice Regularly: Practice is key to mastering any skill. Make sure to practice regularly and work on real-world data science problems to improve your skills.
Remember that learning Python for data science is a continuous process, so be patient and persistent in your efforts. Good luck!
👍5❤3
Step-by-Step Approach to Learn Python
➊ Learn the Basics → Syntax, Variables, Data Types (int, float, string, boolean)
↓
➋ Control Flow → If-Else, Loops (For, While), List Comprehensions
↓
➌ Data Structures → Lists, Tuples, Sets, Dictionaries
↓
➍ Functions & Modules → Defining Functions, Lambda Functions, Importing Modules
↓
➎ File Handling → Reading/Writing Files, CSV, JSON
↓
➏ Object-Oriented Programming (OOP) → Classes, Objects, Inheritance, Polymorphism
↓
➐ Error Handling & Debugging → Try-Except, Logging, Debugging Techniques
↓
➑ Advanced Topics → Regular Expressions, Multi-threading, Decorators, Generators
Free Python Resources: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
ENJOY LEARNING 👍👍
➊ Learn the Basics → Syntax, Variables, Data Types (int, float, string, boolean)
↓
➋ Control Flow → If-Else, Loops (For, While), List Comprehensions
↓
➌ Data Structures → Lists, Tuples, Sets, Dictionaries
↓
➍ Functions & Modules → Defining Functions, Lambda Functions, Importing Modules
↓
➎ File Handling → Reading/Writing Files, CSV, JSON
↓
➏ Object-Oriented Programming (OOP) → Classes, Objects, Inheritance, Polymorphism
↓
➐ Error Handling & Debugging → Try-Except, Logging, Debugging Techniques
↓
➑ Advanced Topics → Regular Expressions, Multi-threading, Decorators, Generators
Free Python Resources: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
ENJOY LEARNING 👍👍
👍9❤6🙏1
5 Python Projects for beginners 👇
https://youtu.be/kjemNqhAQVA?si=10jSVUKzSSfD1Ubl
Like for more free resources ❤️
https://youtu.be/kjemNqhAQVA?si=10jSVUKzSSfD1Ubl
Like for more free resources ❤️
👍8❤2🔥1