Given the following dataframe In [8]: val_1 = np. random.normal(loc = 10, scale=3, size=1000 ) val_2 = np.random.choice(

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Given the following dataframe In [8]: val_1 = np. random.normal(loc = 10, scale=3, size=1000 ) val_2 = np.random.choice(

Post by answerhappygod »

Given The Following Dataframe In 8 Val 1 Np Random Normal Loc 10 Scale 3 Size 1000 Val 2 Np Random Choice 1
Given The Following Dataframe In 8 Val 1 Np Random Normal Loc 10 Scale 3 Size 1000 Val 2 Np Random Choice 1 (57.91 KiB) Viewed 43 times
Given the following dataframe In [8]: val_1 = np. random.normal(loc = 10, scale=3, size=1000 ) val_2 = np.random.choice(['Chocolate', 'Icecream', 'Apple'], size=len(val_1), replace=True) df = pd. DataFrame({'X':val_1, 'y':val_2}) df Out[8]: x у 0 7.263616 Chocolate 1 9.295601 Icecream 2 6.871386 Icecream 3 6.059927 Chocolate 4 5.574106 Chocolate 995 6.355084 Icecream 996 6.919248 Chocolate 997 8.750277 Icecream 998 9.305044 Icecream 999 3.464517 Chocolate 1000 rows x 2 columns Drop all rows that the index is a factor of 7
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply