Question: P 1 . Using any process you like, create the following table as a pandas DataFrame named Vendors . The top row is column names;

P1. Using any process you like, create the following table as a pandas DataFrame named Vendors. The top row is column names; the left-most column is row names:
Office Stuff Superstore Medingstone, Inc. Treadstone, Inc.
address 43 Wallaby Way 1337 Broadmore Ave. 415 East 71st St.
City Sydney New York City New York City
State ND NY NY
zipcode 584011010810021
Phone 701-456-1557212-683-1448212-413-3322
supply_type Office Supplies Therapy Tools Other Assets
P2. Transpose the Vendors DataFrame and re-save it with the same name.
P3. Create a new column named vendor_name with the same values as the row names (after transposition).
P4. Create a column of zeroes named NY.
P5. In a single statement, replace the values in NY with 1 if the state variable is equal to NY.
P6. Use a summary method from Table 5-8 on pg.162 of PDA to calculate how many vendors are from NY.
P7. Use a summary method from Table 5-8 on pg.162 of PDA to calculate the proportion of vendors that are from NY.
P8. Drop the NY column from your DataFrame.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!