Posts

Numpy Tricks

Image
                                                                                                              Follow me on  LinkedIn ,  GitHub ,  YouTube NumPy  tricks with coding examples and outputs -Anupam Shrivastava NumPy stands for Numerical Python, and it is a Python library used for working with arrays. It is particularly useful for scientific computing tasks, such as linear algebra, Fourier transform, and random number capabilities, and is widely used in the data science and machine learning communities. NumPy provides efficient and convenient operations for numerical arrays, and it also offers built-in functions for mathematica...

10 PANDAS TRICKS

Image
Follow me on  LinkedIn ,  GitHub ,  YouTube 10 Pandas tricks that can help you in data manipulation and analysis -Anupam Shrivastava 1. Use iloc to select rows and columns: You can use the iloc function to select rows and columns in a Pandas DataFrame using the index positions. This code selects the first two rows and first two columns of the DataFrame using iloc, which returns a new DataFrame containing only those rows and columns. The resulting output will be: Note that iloc uses zero-based indexing, so iloc[:2, :2] selects the first two rows and first two columns. You can also use iloc to select specific rows and columns based on their integer positions. For example, df.iloc[[0, 2], [1, 2]] selects the first and third rows and the second and third columns.

10 Python Tricks To Learn Before You Write Your Next Code

Image
10 Python Tricks To Learn Before You Write Your Next Code - Anupam Shrivastava   Some useful tips or techniques that would simplify the work of a Python developer Introduction As a Python developer, there are always new tips and techniques to learn that can make your work more efficient and effective. In this article, we will explore some useful tricks and techniques that can help simplify your work and make you a more productive Python developer. From list comprehensions to unpacking argument lists, using defaultdict() to create dictionaries with default values, and applying functions to lists using map() and filter(), these tips will save you time and make your code more concise and readable. So, whether you are a beginner or an experienced Python developer, read on to discover some useful tips and techniques that will take your coding skills to the next level. 1.  Use list comprehensions to create lists more efficiently. Using list comprehensions is a very efficient wa...