From 669c6f8f76e8bd1f093b4648ab7552b2221775f4 Mon Sep 17 00:00:00 2001 From: LemonHX Date: Fri, 9 Sep 2022 05:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B5=E6=AF=8D=E6=B2=A1=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=98=AF=E4=BB=80=E4=B9=88=E9=AD=94=E9=AC=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/generate.py b/generate.py index 9767815..b150d62 100644 --- a/generate.py +++ b/generate.py @@ -31,8 +31,10 @@ def c_py(x): yton = y[-1] if not yton.isdigit(): yton = 5 - md.append([x[0],yini, yfin, yton]) - md.append([x[0],ini, fin, ton]) + if yfin != "": + md.append([x[0],yini, yfin, yton]) + if fin != "": + md.append([x[0],ini, fin, ton]) Mandarin.apply(c_py,axis=1) Mandarin = pd.DataFrame(md,columns=["zi","shengmu","yunmu","diao"]) Mandarin = Mandarin.drop_duplicates()