Run the following code cell. By using df88_1, df88_2 and df88_3, write codes to perform an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Run the following code cell. By using df88_1, df88_2 and df88_3, write codes to perform an intersecting (inner) join by using column ten as "primary key", name the output dataframe as mydf88, make sure mydf88 has 2 rows and 6 columns. Your codes should make sure the following code cell will print the desired output (shown below) 1: # Run this cell. DO NOT change anything! import pandas as pd import numpy as np from numpy import nan as NA import string rgen = np.random. RandomState (random_state) df88_1 = pd.DataFrame (rgen.randn(20).reshape ((5,4)), index=list('ABCDE'), columns=['ten', 'two', 'three', 'four']) df88_1['ten'] = df88_1.index.tolist () display(df88_1) df88_2= pd.DataFrame (np.arange (50,34,-2). reshape((4,2)), index=np. array(list(string.ascii_uppercase) ) [range(0,12,3)], columns=['ten', 'batman']) df88_2['ten'] = df88_2.index.tolist() display (df88_2) df88_3 = pd.DataFrame(np. array(['MARKET', 'DISC', 'FINA', 'ENERGY', 'ACCT']).reshape ((5,1)), index=df88_1.index.tolist (), columns=['department']) df88_3.reset_index(inplace=True, drop-False) df88_3. rename (columns={'index': 'ten'}, inplace=True) display (df88_3) C D E A B B -2.301539 A D 7 ten 0 G G 3 4 two A -0.611756 -0.528172 -1.072969 1.744812 -0.761207 C -0.249370 1.462108 -2.060141 D -0.384054 1.133769 -1.099891 E -0.877858 0.042214 0.582815 ten batman A ten department A MARKET 1 B 2 с D E 48 44 40 36 three DISC FINA ENERGY ACCT four Run the following code cell. By using df88_1, df88_2 and df88_3, write codes to perform an intersecting (inner) join by using column ten as "primary key", name the output dataframe as mydf88, make sure mydf88 has 2 rows and 6 columns. Your codes should make sure the following code cell will print the desired output (shown below) 1: # Run this cell. DO NOT change anything! import pandas as pd import numpy as np from numpy import nan as NA import string rgen = np.random. RandomState (random_state) df88_1 = pd.DataFrame (rgen.randn(20).reshape ((5,4)), index=list('ABCDE'), columns=['ten', 'two', 'three', 'four']) df88_1['ten'] = df88_1.index.tolist () display(df88_1) df88_2= pd.DataFrame (np.arange (50,34,-2). reshape((4,2)), index=np. array(list(string.ascii_uppercase) ) [range(0,12,3)], columns=['ten', 'batman']) df88_2['ten'] = df88_2.index.tolist() display (df88_2) df88_3 = pd.DataFrame(np. array(['MARKET', 'DISC', 'FINA', 'ENERGY', 'ACCT']).reshape ((5,1)), index=df88_1.index.tolist (), columns=['department']) df88_3.reset_index(inplace=True, drop-False) df88_3. rename (columns={'index': 'ten'}, inplace=True) display (df88_3) C D E A B B -2.301539 A D 7 ten 0 G G 3 4 two A -0.611756 -0.528172 -1.072969 1.744812 -0.761207 C -0.249370 1.462108 -2.060141 D -0.384054 1.133769 -1.099891 E -0.877858 0.042214 0.582815 ten batman A ten department A MARKET 1 B 2 с D E 48 44 40 36 three DISC FINA ENERGY ACCT four
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A closed-end fund has total assets of $240 million and liabilities of $110,000. Currently, 11 million shares are outstanding. What is the NAV of the fund? If the shares currently sell for $19.25,...
-
Ella, a portfolio manager, considered several ways to invest USD15 million for one year. The data are as follows: USD interest: 7% per annum (p.a.) GBP interest: 10% p.a. Spot exchange rate:...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
In this photo, Ramu is eating raw meat. What do Ramus behaviors suggest about how we develop self-concepts? Would you define Ramu as a human or a wolf?
-
A friend tells you that when she takes off her eyeglasses and holds them 23 cm above a printed page the image of the print is erect but enlarged to 1.5 times its actual size. (a) Is the image real or...
-
Extend the analysis conducted in Problem 11.8 by relaxing the assumption that the solute concentration C A, s remains constant. In a practical applications, C A, s will vary as a result of adsorption...
-
The financial statements of Gibson Corporation for the first two years of operations reflected the following amounts. Assume a tax rate of \(25 \%\) for 2020 and 2021. Estimates of future earnings at...
-
Analyzing the Effects of Transactions Using T-Accounts, Preparing Financial Statements, and Evaluating the Total Asset Turnover Ratio as a Manager Brianna Webb, a connoisseur of fine chocolate,...
-
Karim Corporation requires a minimum $8,500 cash balance. Loans taken to meet this requirement cost 2% interest per month (paid at the end of each month). Any preliminary cash balance above $8,500 is...
-
1. Using the data input provided (Exhibit 1), prepare LAFs master budgets in Excel. Do not hard-code numbers into the spreadsheet, except in the financing section of the cash budget. 2. Conduct a...
-
The function f(x)=4x+3 is one-to-one. Find an equation for f(x), the inverse function.
-
Sheila takes Josie, her niece, to the park to play on the slides. Josie starts from rest a top a 4 . 7 6 - meter high slide. She is moving at 8 . 0 1 m / s when she reaches the bottom. What...
-
Given the following program segment : public class ABC { public static void main(String[] args) { int i = 1; while ( i
-
Portsmouth Company makes upholstered furniture. Its only variable cost is direct materials. The demand for the company's products far exceeds its manufacturing capacity. The bottleneck (or...
-
A 5.0-kg block slides down an incline that is 30 below the horizontal. The coefficient of kinetic friction between the Surface and the Block is = 0.25. What is the acceleration of the block as it...
-
Guests Hotel Inc. is located downtown in your city. Guests Hotel is a boutique hotel with 100 rooms, a restaurant, a lounge bar, and a convention center. The rooms department is doing quite well with...
-
A health care professional wants to determine whether individuals with hypertension who take Atenololhave significantly lower systolic blood pressure than individuals with hypertension who do not...
-
What are the risks and liability factors in an audit? What are the implications to the auditor? What are the implications to the organization? How can the auditor mitigate these risks and liability...
-
Frank Willingham has the following transactions during the year: Sale of office equipment on March 15 that cost $20,000 when purchased on July 1, 2010. Frank has claimed $5,000 in depreciation and...
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
Quince Interests is a partnership with a tax year that ends September 30, 2012. During that year, Potter, a partner, received $3,000 per month as a guaranteed payment, and his share of partnership...
-
Imagine that you have \($10,000\) to invest. Use a newspaper, the Internet, or other source to select a mutual fund. Use the same source to fi nd out how much gold you could buy for \($10,000\)....
-
Animation art, hand-painted images from which cartoons used to be made, is a popular collectible.
-
The PBS television program, Antiques Roadshow, has generated enormous interest among viewers to find out the value of the furniture, art, jewelry, and collectibles they own.
Study smarter with the SolutionInn App