Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages.
Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas
dataframe.get() function is used to get item from object for given key. The key could be one or more than one dataframe column. It returns default value if not found.
Syntax: DataFrame.get(key, default=None)
Parameters :
key : object
Returns : value : type of items contained in object
For link to CSV file Used in Code, click
here
Example #1: Use
get() function to extract a column out of the dataframe
Output :
👁 Image
Now apply the
get() function. We are going to extract the "Salary" column from the dataframe.
Output :
👁 Image
Notice, the output is not a dataframe but a pandas series object.
Example #2: Use
get() function to extract multiple columns at a time in random order