QuestionQuestion

Design and write a python program that will read the excel file into a numpy two-dimensional array. The program should perform the following actions:

1. do not read column 1 into the numpy array since it contains the row headers
2. do not read row 1 into the numpy array since it contains the column headers
3. use the column and row headers to create 2 one-dimensional lists for printing
4. print the array created from the spreadsheet and produce output showing the data with row and column totals and headers

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import numpy as np
import pandas as pd

# read the excel file, exclude its labels and store it in pandas dataframe
df = pd.read_excel('lab7-99.xlsx', index_col=0)

# exclude headers and create a numpy array with numbers, also print the array
arr = np.array(df[0:15])
print("Numpy Array")
print(arr, "\n")

# create a list of column names
cols_names = df.columns.values

# create a helping list that will be used later
cols = ['Department']
for i in range(0, len(cols_names)):
    cols.append(cols_names[i])...

By purchasing this solution you'll be able to access the following files:
Solution.py.

50% discount

Hours
Minutes
Seconds
$10.00 $5.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats