import pandas as pd
# 创建一个空的DataFrame
df = pd.DataFrame()
# 判断DataFrame是否为空
if df.empty:
print("DataFrame is empty.")
else:
print("DataFrame is not empty.")
注意:empty
是df的属性,不是方法,用的时候不要加()
import pandas as pd
# 创建一个空的DataFrame
df = pd.DataFrame()
# 判断DataFrame是否为空
if df.empty:
print("DataFrame is empty.")
else:
print("DataFrame is not empty.")
注意:empty
是df的属性,不是方法,用的时候不要加()
评论列表,共 0 条评论
暂无评论