Band and bandgap [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am doing an assignment for class and have this question: "Create a target array gap for bandgap - the difference between lumo_zindo and homo_zindo." I do not understand or know what they are asking. In class, we simply learned how to plot multilinear regression so I have no clue what gap or bandgap are.

Wikipedia goes a long way toward explaining your question about lumo_zindo and homo_zindo.
They're referring to electron orbitals. HOMO is the Highest Occupied Molecular Orbital. LUMO is the Lowest Occupied Molecular Orbital. The Band Gap is the Energy delta between the two.
Check out the links for reference:
https://en.wikipedia.org/wiki/HOMO_and_LUMO
https://en.wikipedia.org/wiki/ZINDO
As far as creating the gap Array in python (assuming lumo_zindo and homo_zindo are both lists that contain the same numeric data type), I'd try:
gap = []
for h,l in zip(homo_zindo, lumo_zindo):
gap.append(h - l)

Related

How do I read the last item from a list that's inside of a list that's all part of a single variable [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I'm making a blackjack game that requires me to calculate the scores at the end of multiple games such as what your cards added up to at the end of the games and find out the mean, mode and frequency. I've gotten the data laid out in a spread sheet but can't figure out how to read and add the score from the separate games since they're all being added together into one variable
My python code that prints and reads out the stats
The stats my code gets the data from

Using a Python dictionary value in a calculation [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
I have some Python code that takes user input for mass and diameter of an object. Those data parameters I later use in a calculation formula. Instead of having the user input those two values, I now have a dictionary that stores the values. How can I now have those values extracted from the dictionary and placed into the calculation formula? I'm very new to Python and trying to figure out if this done via a while loop or defining an function within a while loop, etc.
Thanks.

Multiplication of matrices stored in lists [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am struggling to multiply lists as matrices in Python.
I have two lists (weights and returns) and I need to multiply them as: weights*TRANSPOSE(returns).
How are Weights and Return defined in your code?
You might be able to do the following:
#This sums the entries
matrixProduct = 0
for i in range(len(Weights)):
matrixProduct+= Weights[i]*Return[i]
#In case you meant to keep products of individual pairs of matrix entries (not sure from your notation):
matrixProduct = []
for i in range(len(Weights)):
matrixProduct.append(Weights[i]*Return[i])

How to find a rate at which data is growing with pandas? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a pandas DataFrame where there is a column which contains the new number of covid cases per day.
After plotting that I get this graph :
Now I want to find out at what rate the cases are growing so how can I do this ?
The rate at which cases grow will be: (cases in current day - cases in previous day) / cases in previous day
There are several ways to do this. The easiest is to use df.pct_change()

How to calculate powers of complex numbers in Python without using the complex numbers data type [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm wondering how I can calculate powers of a complex number without using the complex numbers data type. So I have a function
def Power_complex(re, im, n):
How can I calculate (re + im * i)^n with this? Thank you!
You can use the Biniomial theorem for arbitrary exponents, although positive integers is the easiest case.
Or you can treat the problem in polar coordinates (this link simply gives you the answer, only click if you really don't want to figure it out on your own)

Categories