I have written an application that runs a FastAPI server inside a Kubernetes pod. The external communication with the pod goes through an nginx ingress controller in a separate pod. I am running nginx:1.17.0.
When it is all up and running I can use curl calls to interact with the app server through the ingress address, and access all the simple GET paths as well as address/openapi.json in my browser. I can also access the interactive documentation page if I …
我有一个包含许多 NoneType 值的数据框,我想删除所有行值和标题为 None 的所有列。我正在努力寻找一种方法来做到这一点。在下面的MWE中,我设法要么删除所有行都为 None 的所有列,要么删除标题为 None 的所有列。
from __future__ import annotations
import pandas as pd
d = [[1, 2, None, None, None], [4, 5, None, None, 7]]
cols = ['a', 'b', 'c', None, None]
df = pd.DataFrame(data=d, columns=cols)
print("Original: \n", df)
#Original:
# a b c NaN NaN
#0 1 2 None None NaN
#1 4 5 None None 7.0
print("\nDropped how = all: \n", df.dropna(axis=1, how="all")) # Drops column 'c'
#Dropped how = all:
# …Run Code Online (Sandbox Code Playgroud)