Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python help! I need help creating a plot from an excel data sheet. I included a screenshot of what i have done for the project
Python help! I need help creating a plot from an excel data sheet. I included a screenshot of what i have done for the project so far and the data table. 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.
QUESTION: plot the XRD data of the material named AlNi5(missing value can be regarded as 0). Use plt.savefig() function
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 attributes [1:]: mapA2Index [x.strip()]-index index+-1 spacecount-0 for Line in Lines LL1 materials-line.strip).split(',') for data in materials [1:]: check-data.strip() if check.isspace(): spacecount+1 elif len(check.split))0 spacecount+1 intensitycount-0 for line in lines [1:] 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 totalintensity-0 for line in lines [1:: materials-Line, strip( ) . split(' ' totalintensity+-float (materials [0]) averageintensity-totalintensity/len(lines [1:])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