Python How-To
eBook - ePub

Python How-To

63 techniques to improve your Python code

  1. 504 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Python How-To

63 techniques to improve your Python code

About this book

Have you ever asked yourself, "How do I do that in Python?" If so, you'll love this practical collection of the most important Python techniques. Python How-To includes over 60 detailed answers to questions like:

  • How do I join and split strings?
  • How do I access dictionary keys, values, and items?
  • How do I set and use the return value in function calls?
  • How do I process JSON data?
  • How do I create lazy attributes to improve performance?
  • How do I change variables in a different namespace?


…and much more Python How-To walks you through the most important coding techniques in Python. Whether you're doing data science, building web applications, or writing admin scripts, you'll find answers to your "how-to" questions in this book. Inside you'll find important insights into both Python basics and deep-dive topics to help you skill-up at any stage of your Python career. Author Yong Cui's clear and practical writing is instantly accessible and makes it easy to take advantage of Python's versatile tools and libraries. Perfect to be read both from cover to cover, and whenever you need help troubleshooting your code.About the Technology Python How-To uses a simple but powerful method to lock in 63 core Python skills. You'll start with a question, like "How do I find items in a sequence?" Next, you'll see an example showing the basic solution in crystal-clear code. You'll then explore interesting variations, such as finding substrings or identifying custom classes. Finally, you'll practice with a challenge exercise before moving on to the next How-To.About the BookThis practical guide covers all the language features you'll need to get up and running with Python. As you go, you'll explore best practices for writing great Python code. Practical suggestions and engaging graphics make each important technique come to life. Author Yong Cui's careful cross-referencing reveals how you can reuse features and concepts in different contexts.What's InsideHow to:

  • Join and split strings
  • Access dictionary keys, values, and items
  • Set and use the return value in function calls
  • Process JSON data
  • Create lazy attributes to improve performance
  • Change variables in a different namespace


…and much more.About the ReaderFor beginning to intermediate Python programmers.About the Author Dr. Yong Cui has been working with Python in bioscience for data analysis, machine learning, and tool development for over 15 years. Table of Contents 1 Developing a pragmatic learning strategy
PART 1 - USING BUILT-IN DATA MODELS
2 Processing and formatting strings
3 Using built-in data containers
4 Dealing with sequence data
5 Iterables and iterations
PART 2 - DEFINING FUNCTIONS
6 Defining user-friendly functions
7 Using functions beyond the basics
PART 3 - DEFINING CLASSES
8 Defining user-friendly classes
9 Using classes beyond the basics
PART 4 - MANIPULATING OBJECTS AND FILES
10 Fundamentals of objects
11 Dealing with files
PART 5 - SAFEGUARDING THE CODEBASE
12 Logging and exception handling
13 Debugging and testing
PART 6 - BUILDING A WEB APP
14 Completing a real project

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Python How-To by Yong Cui in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Processing. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Manning
Year
2023
eBook ISBN
9781638352037
Edition
0

Table of contents

  1. inside front cover
  2. Python How-To
  3. Copyright
  4. dedication
  5. contents
  6. front matter
  7. 1 Developing a pragmatic learning strategy
  8. Part 1 Using built-in data models
  9. 2 Processing and formatting strings
  10. 3 Using built-in data containers
  11. 4 Dealing with sequence data
  12. 5 Iterables and iterations
  13. Part 2 Defining functions
  14. 6 Defining user-friendly functions
  15. 7 Using functions beyond the basics
  16. Part 3 Defining classes
  17. 8 Defining user-friendly classes
  18. 9 Using classes beyond the basics
  19. Part 4 Manipulating objects and files
  20. 10 Fundamentals of objects
  21. 11 Dealing with files
  22. Part 5 Safeguarding the codebase
  23. 12 Logging and exception handling
  24. 13 Debugging and testing
  25. Part 6 Building a web app
  26. 14 Completing a real project
  27. Appendix A. Learning Python with REPL in IDLE
  28. Appendix B. Managing Python packages with pip
  29. Appendix C. Using Jupyter Notebook: A web-based interactive Python editor
  30. Appendix D. Integrating version control into your project
  31. Appendix E. Preparing your package for public distribution
  32. Appendix F. solutions to the challenges
  33. index
  34. inside back cover