How to modify one column’s null values based on another column?

I have 12 columns of ingredients and 12 respective columns of measurements of those ingredients. For some rows the ingredients are specified but the measurements are not i.e. they are NA. I want to set up a condition such that if a certain ingredient entry is not NA and the corresponding entry is NA, set the corresponding measurement entry to 1.

How to return multiple values from a request using FastAPI?

I’m trying to create an API using FastAPI + MongoDB that can return multiple values from the request. The MongoDB is full of data and using mongoengine I can consult one or all data when sending a request to the specific endpoint.
What I’m trying to do now is receive one or more data from an endpoint, for example:

Pandas Dataframe Generating Two new columns in a Dataframe that generate a count based on Conditional Parameters

Thank you for your time. I am not an advanced programmer. I am taking 1 programming course. I understand the basics and an okay amount of Python. Please don’t destroy the little confidence I have in programming. I realize the answer may exist but I haven’t found it yet with my searching skills.