Reading a text file line by line is one of the common activities you do while dealing with a big text file. Often, you are not interested in initial few lines and want to skip them and work with rest of the file. The initial few lines of the text file that you want to […]
How to Get Unique Values from a Column in Pandas Data Frame?
In this tutorial, we will learn how to get unique values of a column in a Pandas dataframe using two approaches. We will first use Pandas unique() function to get unique values of a column and then use Pandas drop_duplicates() function to get unique values of a column. Pandas unique() function To Get Unique values […]
Why can’t ggplot2 use %>% instead of “+”?
Have you ever mixed up dplyr’s pipe operator or magittr %>% with ggplot’s “+” while piping dplyr commands with ggplot2, you are not alone. Depending on where you misused “%>%” for “+”, you might get confusing errors like Error: Mapping must be created by `aes()` or `aes_()` Error in as.vector(x, “character”) : cannot coerce type […]
Interested in Data Science? Follow DataFramed Podcast from Datacamp
Datacamp, one of the leading data science education portal with over 100 courses on variety of data science aspects in both Python and R, has launched a new podcast named “DataFramed“. The main theme of the podcast DataFramed is, you guessed it, data science. DataFramed is a weekly data science podcast hosted by DataCamp’s Hugo Bowne-Anderson. […]
How To Add a New Column Using a Dictionary in Pandas Data Frame ?
Creating a new column to a dataframe is a common task in doing data analysis. And this task often comes in a variety of forms. Earlier we saw how to add a column using an existing columns in two ways. In this post we will learn how to add a new column using a dictionary […]