简体   繁体   English

如何通过Python3.7中的Pandas Data Frame验证Excel工作表中的特定单元格值

[英]How do I verify specific Cell Value in an Excel Sheet through Pandas Data Frame in Python3.7

I have an Excel Sheet having some values, one such cell has Yes/No written in it. 我有一张包含一些值的Excel工作表,其中一个这样的单元格写有“是/否”。 Since I have linked the entire file in Python and made a Data Frame of it, how do I verify specific cell values so that only the rows with No value can be printed? 由于我已经用Python链接了整个文件并制作了一个数据框,因此如何验证特定的单元格值,以便只能打印没有值的行?

import pandas as pd
data = pd.read_excel(r'/Volumes/SSD/Project/Raw_Data/Light.xlsx')
df1 = pd.DataFrame(data)
df3 = pd.DataFrame(data , columns = ['Person in Room'] ) //Help Needed

Do these following steps: 请执行以下步骤:

# Takes in Light.xlsx as dataframe
datacheck = pd.read_excel(r'/Volumes/SSD/Project/Raw_Data/Light.xlsx')

# Prints all rows with NaN values
datacheck[datacheck.isna().any(axis=1)]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python:如何快速创建一个 pandas 数据框,其中只有来自大型 excel 表的特定列? - Python: How to quickly create a pandas data frame with only specific columns from a big excel sheet? 通过 API 端点 Python3.7 获取大量数据 - Fetch large amount of data through an API endpoint Python3.7 如何使用Python将特定的数组值保存到Excel中的单元格? - How do I save a specific array value to a cell in Excel with Python? Python3.7如何从列表中提取数值 - Python3.7 how to extract numerical value from list 如何在python3.7中使用yolov2进行语义分割? - How to do semantic segmentation using yolov2 in python3.7? 为python3.7 Ubuntu 18.04安装熊猫 - Install pandas for python3.7 Ubuntu 18.04 如何使用Pandas将python Web抓取数据导出到现有excel文件中的特定工作表? - How can I export my python web scrape data to a specific sheet in an existing excel file using pandas? 如何在 ubuntu 上的 python3.7 中安装 opencv? - How can i install opencv in python3.7 on ubuntu? Python/Pandas:如何根据个人 ID 替换 Pandas 数据框的特定值? - Python/Pandas: How do I replace specific values of a Pandas Data Frame based on individual id? Pytest 夹具不适用于 python3.7 - Pytest fixtures do not work with python3.7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM