我想选择具有多列(以下示例中的 4 列)的行作为空值。我使用了以下代码:
data[(data['relevent_experience'].isnull())&data['education_level'].isnull())&data['major_disciplne'].isnull())&data['relevent_experience'].isnull())]
Run Code Online (Sandbox Code Playgroud)
这是一段非常复杂的代码。有没有更干净的方法来做同样的事情?
我正在尝试从 jupyter notebook 运行一个名为“Volatility_Spreadsheet_Prepare.py”的程序,同时将多个文件作为参数传递给程序。我的代码如下:
for filename in all_csv_files:
%run 'Volatility_Spreadsheet_Prepare.py' filename
Run Code Online (Sandbox Code Playgroud)
此处all_csv_files包含当前目录中所有 CSV 文件的列表。该程序将文件名作为参数。
在这里,jupyter notebook 将文件名视为字符串,而我希望它考虑存储在 for 循环的变量“文件名”中的名称。我该怎么做呢?