Often you may want to loop through each line from a file and do something to each line. Yes, you can use Python or other programming language to do that. However, a simple bash script can be extremely useful in looping through lines in a file. Here is how to loop through lines in a […]
f-string in Python 3.6 for formatting strings
If you are new to Python 3, learning to use f-string, Python’s relatively new string formatting is a lot of fun. f-string, a short name for “formatted string literal”, is a string literal that is prefixed with letter ‘f’ or ‘F’ and is available from Python version 3.6 There are multiple options to format a […]
An Introduction to Altair: A Python Visualization Library
Altair is kind of the new kid in the data visualization block. Altair is declarative visualization library that uses grammar of interactive graphics, built on Vega and Vega-lite. Vega-Lite enables concise descriptions of visualizations as a set of encodings that map data fields to the properties of graphical marks. Altair API kind of works as […]
vega_datasets: A Python Package for Datasets
When you are trying to learn the basics of data science or trying out a new Machine Learning algorithm, an important thing you need is a suitable real world dataset. Often, getting the data set in the right format may be tricky and one may need to spend too much time to search, download and […]
How To Reset Index in Pandas Dataframe?
In this post, we will learn how to reset index in Pandas dataframe starting from zero. We will use pandas reset_index() function to reset index of a dataframe. Often you start with a big dataframe in Pandas and after manipulating and filtering the data frame you will end up with much smaller data frame. When […]