小编Kaj*_*jsa的帖子

FastAPI docs not working with nginx Ingress controller

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 …

nginx kubernetes kubernetes-ingress nginx-ingress fastapi

8
推荐指数
2
解决办法
9402
查看次数

删除所有行和标题为 na 的数据框列

我有一个包含许多 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)

python dataframe pandas

3
推荐指数
2
解决办法
251
查看次数