Question
Python help! I am writing a program that reads an excel file to answer some questions. In the data sheet (attached image) each line shows
Python help! I am writing a program that reads an excel file to answer some questions. In the data sheet (attached image) each line shows the XRD data of all the materials given a specific Intensity (Arb. Units). AlNi* are the name of the materials. Each column shows the XRD data of one material. I attached a screen shot of the data and what i have done so far for other questions. These are the questions I need to answer. I know how to find an average using sum in python but am not sure how to do it with reading the excel file! Thank you!
What is average intensity?
What is the highest intensity?
What is the lowest intensity?
from math import * file-open("4material.csv","r") lines-file. readlines) # print(lines) attributes-lines [0] . strip ( ) . split (", ") mapA2Index-th index-0 for x in attributes1:] index+-1 spacecount-0 for line in lines [1:]: ) materials-Line. strip( ) . split ( for data in materials [1:]: check-data.strip() if check.isspace(): spacecount++1 elif len (check.split()) spacecount+1 intensitycount-0 for Line in LineSL1: intensitycount+1 zerocount-0 for line in lines [1:]: materials-line.strip().split(',') for data in materials [1:]: check-data.strip() if check"0": zerocount+-1 print("How many materials the data has:", index) print("How many missing values the data has:", spacecount) print("How many different intensities the data has:", intensitycount) print "How many zeros the data has:", zerocount)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started