You are on page 1of 17

Notes Bureau

Home HTML CSS T Factor Hands-On Fresco Play Blockchain AWS Azure IOT

Champions Academy
Champions Academy
Suitable for 5 - 15 years old .

Directions

Home  FrescoPlay

Python Pandas Fresco Play


Hands-on Solutions
 Notes Bureau  August 13, 2021

  Facebook  Twitter   

Python Pandas Fresco Play Hands-on Solutions

Disclaimer: The main motive to provide this solution is to help and support those
who are unable to do these courses due to facing some issueJoinand having aChannel
Telegram little 
bit lack of knowledge. All of the material and information Join
contained on this
Notes Bureau Lets Teach and
website is for knowledge and education purposes only. Learn

 Join Telegram Channel


Try to understand these solutions and solve your Hands-On problems. (Not
encourage copy and paste these solutions)
Course Path: Data Science/DATA
SCIENTIST'S TOOLBOX/Python Pandas

All Question of the Quiz Present Below


for Ease Use Ctrl + F to find the Question.

Suggestion: If you didn't find the question, Search by options to get a more
accurate result.

1.Welcome to Python Pandas | 1 | Data


Structures in Pandas(60 Min)

Pandas Data Structures - Hands-on


For
Disc

File Name: prog.py

import pandas as pd

import numpy as np
Mos
heights_A =
pd.Series([176.2,158.4,167.6,156.2,161.4]) Join Telegram Channel 

heights_A.index =
['s1','s2','s3','s4','s5'] Join Notes Bureau Lets Teach and
Learn

print(heights_A.shape)
 Join Telegram Channel
# TASK 2

weights_A =
pd.Series([85.1,90.2,76.8,80.4,78.9])

weights_A.index =
['s1','s2','s3','s4','s5']

print(weights_A.dtype)

#TASK 3

df_A = pd.DataFrame()

df_A['Student_height'] = heights_A

df_A['Student_weight'] = weights_A
Cat
print(df_A.shape)

And

#TASK 4 Aut

Boo
my_mean = 170.0
CSS

my_std = 25.0 DC

np.random.seed(100) Dru

Han
heights_B =
pd.Series(np.random.normal(loc = my_mean, scale = my_std, size = 5))
Jav
heights_B.index =
['s1','s2','s3','s4','s5']
Mic

Pyt

Spr
my_mean1 = 75.0
TCS
my_std1 = 12.0
UI

weights_B =
pd.Series(np.random.normal(loc = my_mean1,scale = my_std1,size =
5))

weights_B.index =
['s1','s2','s3','s4','s5']

print(heights_B.mean()) Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn

#TASK 5
 Join Telegram Channel
df_B = pd.DataFrame()
df_B['Student_height'] = heights_B

df_B['Student_weight'] = weights_B

print(df_B.columns)

List of Fresco Play Courses without Hands-On | Fresco Play


HMTL5 Semantics Elements MCQs Answers | Fresco Play

Champions Academy
Champions Academy
Suitable for 5 - 15 years old .

Directions Website

Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn

 Join Telegram Channel


Discover related topics

Data Analysis Jupyter Notebook

Jupyter Notebook Data Analysis

Jupyter Notebook Tutorial Data Analysis

Jupyter Notebook Data Analysis Examples

Data Analysis with Python 3

HMTL5 Semantics Elements Hands-On Solutions | Fresco Play


Styling with CSS3 Hands-On Solutions | Fresco Play
Blockchain Intermedio MCQs Answers | Fresco Play
Blockchain - Potentes Nexus MCQs Answers | Fresco Play
Azure Essentials MCQs Answers | Fresco Play
AWS Essentials MCQs Answers | Fresco Play

2.Welcome to Python Pandas | 3 |


Working with CSV files(90 min)

Working with CSVs

File Name: prog.py

#Write your code here

import pandas as pd

import numpy as np

heights_A =
pd.Series([176.2,158.4,167.6,156.2,161.4])

heights_A.index =
['s1','s2','s3','s4','s5']

weights_A =
pd.Series([85.1,90.2,76.8,80.4,78.9])

weights_A.index =
['s1','s2','s3','s4','s5'] Join Telegram Channel 

Join Notes Bureau Lets Teach and


df_A = pd.DataFrame() Learn

df_A['Student_height'] = heights_A
 Join Telegram Channel

df_A['Student_weight'] = weights_A
df_A.to_csv('classA.csv')

# TASK 2

df_A2 = pd.read_csv('classA.csv')

print(df_A2)

#TASK 3

df_A3 =
pd.read_csv('classA.csv',index_col = 0)

print(df_A3)

#TASK 4

my_mean = 170.0

my_std = 25.0

np.random.seed(100)

heights_B =
pd.Series(np.random.normal(loc = my_mean, scale = my_std, size = 5))

heights_B.index =
['s1','s2','s3','s4','s5']

my_mean1 = 75.0

my_std1 = 12.0

np.random.seed(100)

weights_B =
pd.Series(np.random.normal(loc = my_mean1,scale = my_std1,size =
5))

weights_B.index =
['s1','s2','s3','s4','s5']

df_B = pd.DataFrame()

df_B['Student_height'] = heights_B Join Telegram Channel 

Join Notes Bureau Lets Teach and


df_B['Student_weight'] = weights_B Learn

df_B.to_csv('classB.csv',index = False)
 Join Telegram Channel
print('classB.csv')
#TASK 5

df_B2 = pd.read_csv('classB.csv')

print(df_B2)

#TASK 6

df_B3 = pd.read_csv('classB.csv',header
= None)

print(df_B3)

#TASK 7

df_B4 = pd.read_csv('classB.csv',header
= None, skiprows = 2)

print(df_B4)

3.Welcome to Python Pandas | 4 |


Indexing Dataframes(75 Min)

Hands-on with Indexes Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn

File Name: prog.py


 Join Telegram Channel
#Write your code here

import pandas as pd

import numpy as np

#TASK- 1

DatetimeIndex = pd.date_range(start =
'09/01/2017',end='09/15/2017')

print(DatetimeIndex[2])

#TASK - 2

datelist =
['14-Sep-2017','09-Sep-2017']

date_to_be_searched =
pd.to_datetime(datelist)

print(date_to_be_searched)

#TASK - 3

print(date_to_be_searched.isin(datelist))

#TASK - 4

arraylist = [['classA']*5 +
['classB']*5,['s1','s2','s3','s4','s5']* 2]

mi_index =
pd.MultiIndex.from_product(arraylist,names=['First Level','Second
Level'])

print(mi_index.levels)

Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn

 Join Telegram Channel


4.Welcome to Python Pandas | 5 | Data
Cleaning

Data Cleaning - Handson

File Name: prog.py

#Write your code here

import pandas as pd

import numpy as np

height_A =
pd.Series([176.2,158.4,167.6,156.2,161.4])

height_A.index =
['s1','s2','s3','s4','s5']

weight_A =
pd.Series([85.1,90.2,76.8,80.4,78.9])

weight_A.index =
['s1','s2','s3','s4','s5']

df_A = pd.DataFrame()
Join Telegram Channel 
df_A['Student_height'] = height_A Join Notes Bureau Lets Teach and
Learn
df_A['Student_weight'] = weight_A

 Join Telegram Channel


df_A.loc['s3'] = np.nan

df_A.loc['s5'][1] = np.nan
df_A2 = df_A.dropna(how = 'any')

print(df_A2)

5.Welcome to Python Pandas | 6 | Data


Aggregation(75 Min)

Data Aggregation - Handson

File Name: prog.py

#Write your code here

import pandas as pd

import numpy as np

heights_A =
pd.Series([176.2,158.4,167.6,156.2,161.4])

heights_A.index =
['s1','s2','s3','s4','s5']

weights_A =
pd.Series([85.1,90.2,76.8,80.4,78.9]) Join Telegram Channel 

weights_A.index =
['s1','s2','s3','s4','s5'] Join Notes Bureau Lets Teach and
Learn

df_A = pd.DataFrame()
 Join Telegram Channel
df_A['Student_height'] = heights_A
df_A['Student_weight'] = weights_A

df_A_filter1 =
df_A[(df_A.Student_weight < 80.0) & (df_A.Student_height >
160.0)]

print(df_A_filter1)

#TASK - 2

df_A_filter2 =
df_A[df_A.index.isin(['s5'])]

print(df_A_filter2)

#TASK - 3

df_A['Gender'] = ['M','F','M','M','F']

df_groups = df_A.groupby('Gender')

print(df_groups.mean())

6.Welcome to Python Pandas | 7 | Data


Merging 1(75
JoinMin)
Telegram Channel 

Data Merge - Hands-on 1 Join Notes Bureau Lets Teach and


Learn

 Join Telegram Channel


File Name: prog.py
import pandas as pd

import numpy as np

height_A =
pd.Series([176.2,158.4,167.6,156.2,161.4])

height_A.index =
['s1','s2','s3','s4','s5']

weights_A =
pd.Series([85.1,90.2,76.8,80.4,78.9])

weights_A.index =
['s1','s2','s3','s4','s5']

df_A = pd.DataFrame()

df_A['Student_height'] = height_A

df_A['Student_weight'] = weights_A

df_A['Gender'] = ['M','F','M','M','F']

s = pd.Series([165.4,82.7,'F'],index =
['Student_height','Student_weight','Gender'],name='s6')

df_AA = df_A.append(s)

print(df_AA)

#TASK - 2

my_mean = 170.0

my_std = 25.0

np.random.seed(100)

heights_B =
pd.Series(np.random.normal(loc = my_mean,scale=my_std,size = 5))

heights_B.index =
['s1','s2','s3','s4','s5']

my_mean1 = 75.0

my_std1 = 12.0 Join Telegram Channel 

Join Notes Bureau Lets Teach and


np.random.seed(100) Learn

weights_B =
pd.Series(np.random.normal(loc = my_mean1,scale=my_std1,size = 5))
 Join Telegram Channel
weights_B.index =
['s1','s2','s3','s4','s5']
df_B = pd.DataFrame()

df_B['Student_height'] = heights_B

df_B['Student_weight'] = weights_B

df_B.index=['s7','s8','s9','s10','s11']

df_B['Gender'] = ['F','M','F','F','M']

df = pd.concat([df_AA,df_B])

print(df)

7.Welcome to Python Pandas | 8 | Data


Merging 2(75 Min)

Data Merge - Hands-on 2

File Name: prog.py

#Write your code here Join Telegram Channel 

import pandas as pd Join Notes Bureau Lets Teach and


Learn
import numpy as np
 Join Telegram Channel
nameid = pd.Series(range(101,111))
name = pd.Series(['person' + str(i) for
i in range(1,11)])

master = pd.DataFrame()

master['nameid'] = nameid

master['name'] = name

transaction =
pd.DataFrame({'nameid':[108,108,108,103],'product':
['iPhone','Nokia','Micromax','Vivo']})

mdf =
pd.merge(master,transaction,on='nameid')

print(mdf)

8.Welcome to Python Pandas | 2 |


Accessing Pandas Data
Structures(90 Min)

Access Elements in Data Structures

File Name: prog.py

Join Telegram Channel 

Join Notes Bureau Lets Teach and


#Write your code here Learn

import pandas as pd
 Join Telegram Channel
import numpy as np
heights_A =
pd.Series([176.2,158.4,167.6,156.2,161.4])

heights_A.index =
['s1','s2','s3','s4','s5']

print(heights_A[1])

# TASK 2

print(heights_A[1:4])

# TASK 3

weights_A =
pd.Series([85.1,90.2,76.8,80.4,78.9])

weights_A.index =
['s1','s2','s3','s4','s5']

df_A = pd.DataFrame()

df_A['Student_height'] = heights_A

df_A['Student_weight'] = weights_A

height = df_A['Student_height']

print(type(height))

# TASK 4

df_s1s2 =
df_A[df_A.index.isin(['s1','s2'])]

print(df_s1s2)

# TASK 5

df_s2s5s1 =
df_A[df_A.index.isin(['s1','s2','s5'])]

df_s2s5s1 =
df_s2s5s1.reindex(['s2','s5','s1'])
Join Telegram Channel 
print(df_s2s5s1)
Join Notes Bureau Lets Teach and
Learn

#TASK 6  Join Telegram Channel

df_s1s4 =
df_A[df_A.index.isin(['s1','s4'])]
print(df_s1s4)

List of Fresco Play Courses without Hands-On | Fresco Play


HMTL5 Semantics Elements MCQs Answers | Fresco Play
HMTL5 Semantics Elements Hands-On Solutions | Fresco Play
Styling with CSS3 Hands-On Solutions | Fresco Play
Blockchain Intermedio MCQs Answers | Fresco Play
Blockchain - Potentes Nexus MCQs Answers | Fresco Play
Azure Essentials MCQs Answers | Fresco Play
AWS Essentials MCQs Answers | Fresco Play

If you want answers to any of the fresco play courses feel free to ask in the
comment section, we will surely help.

Tags FrescoPlay Python TFactor

  Facebook  Twitter   

Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn
You might like Show more

 Join Telegram Channel


 Previous Post Next Post 

Let’s teach and learn

Copyright © 2022 Notes Bureau ABOUT US TERMS

Join Telegram Channel 

Join Notes Bureau Lets Teach and


Learn

 Join Telegram Channel

You might also like