我有一个示例数据框:
col1 col2
0 Hello, is it me you're looking for Hello
1 Hello, is it me you're looking for me
2 Hello, is it me you're looking for looking
3 Hello, is it me you're looking for for
4 Hello, is it me you're looking for Lionel
5 Hello, is it me you're looking for Richie
Run Code Online (Sandbox Code Playgroud)
我想更改 col1 以便删除 col2 中的字符串,并返回修改后的数据帧。我还想删除字符串之前的字符 1 和之后的字符 1,例如,索引 1 的所需输出将是:
col 1 col 2
1 Hello, is ityou're looking for me
Run Code Online (Sandbox Code Playgroud)
我尝试过将pd.apply() …
我有一个 Redis K8s 部署,链接到一个单独的服务,清单大幅减少,如下(如果需要更多信息,请告诉我):
apiVersion: apps/v1
kind: Deployment
spec:
replicas: 2
selector:
matchLabels:
app: cache
environment: dev
template:
metadata:
labels:
app: cache
environment: dev
spec:
containers:
- name: cache
image: marketplace.gcr.io/google/redis5
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 30
timeoutSeconds: 5
volumes:
- name: data
nfs:
server: "nfs-server.recs-api.svc.cluster.local"
path: "/data"
Run Code Online (Sandbox Code Playgroud)
我想定期使用新数据集重新部署 Redis,而不是更新现有缓存。当执行 a 时kubectl rollout restart deployment/cache,旧的 Redis Pod 在新的 Redis Pod 准备好接受流量之前被终止。这些新的 …