It is really good to know whether the code you wrote is efficient or fast. We can test that by checking how long it takes to execute certain commands, or functions. Computing Execution Time With “time” Module One way to get the execution time is to use the built-in time module and its function time.time. […]
Python Tips
5 Examples Using Dict Comprehension in Python
List Comprehension is a handy and faster way to create lists in Python in just a single line of code. It helps us write easy to read for loops in a single line. In Python, dictionary is a data structure to store data such that each element of the stored data is associated with a […]
How to Load a Massive File as small chunks in Pandas?
The longer you work in data science, the higher the chance that you might have to work with a really big file with thousands or millions of lines. Trying to load all the data at once in memory will not work as you will end up using all of your RAM and crash your computer. […]
How To Read a CSV File as Pandas Data Frame?
Pandas is one of the popular Python package for manipulating data frames. Pandas is built on top of NumPy and thus it makes data manipulation fast and easy. One of the most common things one might do in data science/data analysis is to load or read in csv file. Here we see 7 examples to […]
How to Use Lambda Functions in Python?
Python lets you create a function on the go, but without really assigning a name to the function. These “anonymous” functions are called “Lambda Functions”. One typically writes a lambda function on the fly, when one wants to write a function for one-time use. Lambda Functions come handy in a variety of situations and are […]