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?
-
Suppose that we order the edge relaxations in each pass of the Bellman-Ford algorithm as follows. Before the first pass, we assign an arbitrary linear order v1, v2,..., v |v| to the vertices of the...
-
Bartov Corporation reports the following beginning inventory and purchases for 2020: Bartov sells 600 of these units in 2020. Compute its cost of goods sold for 2020 and the ending inventory reported...
-
Use the pain tolerance ratings (PainTolerance) after the activity to estimate the difference in mean pain tolerance between those who just completed a synchronized activity and those who did a...
-
Total tuition is $3050 for full-time students taking 12 credits or more and $125 per credit hour for part-time students (taking less than 12 credits). Use a function to determine the correct tuition...
-
At the end of June, the job cost sheets at Ace Roofers show the following costs accumulated on three jobs. At June 3 0 Job 5 Job 6 Job 7 Direct materials $ 1 8 , 0 0 0 $ 3 4 , 5 0 0 $ 2 8 , 5 0 0...
-
Bill and Kate Theil are not only husband and wife but entrepreneurs who have established three successful businesses. The proposed plan for their latest effort involves a series of international...
-
John Kabuswe, a Zambian resident, retired from employment in 2021. He will commence business as a wholesaler on 1 January 2022, using his retirement benefits and borrowedfunds. He wishes to involve...
-
An important reason why members of the Federal Reserves Board of Governors are each given extremely long, 14-year terms is to: a. insulate members from political pressures that could result in...
-
True or False. In the United States, monetary policy has two key advantages over fiscal policy: (1) isolation from political pressure and (2) speed and flexibility.
-
Use three tools to describe how a process can be improved to standardize its tasks and processes in pursuit of continuous improvement and employee empowerment (principle 6).
-
What are five of the skills of internal auditors that have been identified as essential for success in the future? What can your internal audit department do to develop those skills among its staff?
-
Which group votes on the open-market operations that are used to control the U.S. money supply and interest rates? a. Federal Reserve System b. the 12 Federal Reserve Banks c. Board of Governors of...
-
A table that displays data redundancies produces O Consistencies Anomalies Fewer attributes O more entities
-
In your readings, there were many examples given for nurturing close family relationships in this ever-evolving technological society we live in Based upon your readings and research describe three...
-
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...
-
Calculate: (a) \(f=a /(b c)\), where \(a=2.34\mathrm{~mm}^{2}, b=54.26\mathrm{~m}\), and \(c=0.14\mu \mathrm{m}\); (b) \(g=k t^{3}\), where \(k=1.208\times 10^{-2}\mathrm{~s}^{-3}\) and...
-
Which of these is a hierarchical approach of subordination of individuals that work together and contribute to serve a common goal? Formal organization Informal structures Functional structure ...
-
A sound organization Prevents corruption Enhances creativity None of the above All of the above
Study smarter with the SolutionInn App