Introduction Removing blank rows from an excel sheet should be easy. Instead of digging into the documentation or watching a long video tutorial, just take a look at the following screenshots. Note that this tutorial was prepared using on Mac. For Windows, the procedure should be fairly similar… Select your data range From the Edit
Introduction The vi editor (available on all Unix flavors) might not be as powerful as some GUI editors such as Sublime Text however there are situations where it is the only available option. Anyway, vi is indeed a powerful command based text editor specially if we master the supported commands. Let us now answer the
Introduction Removing blank lines from a file requires two steps. First, we need to loop through the file lines. Second, check if the line is empty. In Python, there are different ways to perform the loop and check. Let us summarize that… Loop method There are multiple styles to iterate through file lines. Here are
Introduction Removing empty lines in a text file from the Unix shell is quite easy. There are a couple of ways to do that. Let us explore a few… Remove empty lines using sed command The stream editor (sed) can be used to filter and transform text. Removing empty lines using sed can be done
Introduction In this Python code snippet post, we are going to implement a list reverse function from the scratch without using any builtin functions. Let us see how… Iterative solution We can use a for loop to swap the first and last items, the second and the one before the last item and so on
Problem Given an input string, provide Python code to remove all special characters except spaces. Solution This is a typical regular expressions question. Please find the answer below.. Code The idea is to match only letters, spaces and exclude everything else. Take a look… That is for today. Thanks for visiting. Questions ? Please use
Introduction In Python, the datetime module can be used to get date and time. This is good but there is something annoying: the milliseconds or the fraction that gets printed by default. How can we get rid of that ? There are a couple of ways to do the trick. Let us see… Example code
Introduction If you skim through Python source code, you may encounter some strings proceeded by a special character such as (b, u). What are these characters? Let us see… The b string prefix The b string prefix in Python 3.x indicates that the string is of type byte stream. If the prefix is not used,
Introduction I think the reason why this topic can be confusing specially to beginners is that it mixes different concepts together. It should not be hard to understand with proper context. In my opinion, to better understand the difference between Args and Kwargs in Python, the following points must be crystal clear… Positional vs keyword
Introduction For more information about for loops in Python, you can find the full article here. So what is the difference between break, continue and pass in Python ? let us borrow some relevant sections from the previous article… Break statement Python like other languages provides a special purpose statement called break. This statement terminates