Pandas Most Asked Questions – Part 2

Pandas Most Asked Questions
This is the second part of the Pandas Most Asked Questions, in the first part we touch base on the basics of Pandas. The sole aim of the post is to cover around 50-60 most asked Pandas questions asked in the Analytics interview (Data Analyst, Business Analyst, Business intelligence Engineer, Data Scientist, Product Analyst)

Pandas Most Asked Questions

Pandas Most Asked Questions – 11 to 20

Microsoft Word – Final_Pandas_Neha.docx

11. What is the name of pandas library tools used to create a scatter plot matrix?
Scatter_matrix is used to create a scatter_plot matrix.

12. What is the describe() method in pandas ?

The describe method is used for calculating mean, min, max and standard deviation of each column of the dataset. It analyzes both numeric and object series.

Syntax : dataframe.describe()

13. How to Covert Json(Javascript object notation) data into Dataframe ?
JSON is a widely used data format for data interchange on the web. We can convert JSON files into data frames by using the pandas library.

14. What is pylab?
PyLab is a package that contains Numpy, Scipy and Matplotlib into a single namespace.

15. How to convert Api into Dataframe?
We can create Api into dataframe:

# Here we import the request module to fetch the Api import requests
import json

# url for the dataframe
url = ‘https://api.github.com/repos/pandas-dev/pandas/issues’ resp = requests.get(url)
data = resp.json()
print(data[2][‘user’])

# Creating the DataFrame
issues = pd.DataFrame(data, columns=[‘number’, ‘title’,

‘labels’, ‘state’])

16. How to Convert the First Character of Each element in a series to uppercase?

# This is our given Series
Ser = pd.Series([‘the ‘ , ‘data’ , ‘monk’]) # Solution 1
Ser.map(lambda x :x.title())
#Solution 2
pd.Series([ i.title() for i in Ser])

17. How to Calculate the number of characters in each word in a series?

# Input
ser = pd.Series([‘The’, ‘data’, ‘monk’])

# Solution ser.map(lambda x: len(x))

18. how many minimum number of arguments do we require to pass in pandas Series ?

We have to pass min 1 argument in pandas Series.

19. How to get the items of Series X not present in Series Y?

import pandas as pd
#Series 1
p1 = pd.Series([2, 4, 6, 8, 10])
# Series 2
p2 = pd.Series([8, 10, 12, 14, 16]) p1[~p1.isin(p2)]

20. How can we convert Series to dataframe ?

We can convert Series into dataframe by using to_frame function.

# Input data
s = pd.Series([“a”, “b”, “c”], name=”column”)
# Conversion of Series into dataframe s.to_frame()

The Data Monk Interview Books – Don’t Miss

Now we are also available on our website where you can directly download the PDF of the topic you are interested in. On Amazon, each book costs ~299, on our website we have put it at a 60-80% discount. There are ~4000 solved interview questions prepared for you.

10 e-book bundle with 1400 interview questions spread across SQL, Python, Statistics, Case Studies, and Machine Learning Algorithms – Ideal for 0-3 years experienced candidates

23 E-book with ~2000 interview questions spread across AWS, SQL, Python, 10+ ML algorithms, MS Excel, and Case Studies – Complete Package for someone between 0 to 8 years of experience (The above 10 e-book bundle has a completely different set of e-books)

12 E-books for 12 Machine Learning algorithms with 1000+ interview questions – For those candidates who want to include any Machine Learning Algorithm in their resume and to learn/revise the important concepts. These 12 e-books are a part of the 23 e-book package

Individual 50+ e-books on separate topics

Important Resources to crack interviews (Mostly Free)

There are a few things that might be very useful for your preparation

The Data Monk Youtube channel – Here you will get only those videos that are asked in interviews with Data Analysts, Data Scientists, Machine Learning Engineers, Business Intelligence Engineers, Analytics managers, etc.
Go through the watchlist which makes you uncomfortable:-

All the list of 200 videos
Complete Python Playlist for Data Science
Company-wise Data Science Interview Questions – Must Watch
All important Machine Learning Algorithm with code in Python
Complete Python Numpy Playlist
Complete Python Pandas Playlist
SQL Complete Playlist
Case Study and Guesstimates Complete Playlist
Complete Playlist of Statistics

Keep Learning !!

Thanks,

Author: TheDataMonk

I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience 3+ years at Mu Sigma 2 years at OYO 1 year and counting at The Data Monk I am an active trader and a logically sarcastic idiot :)