我有一个数据集,我正在尝试将 SQL 查询写入 Pandas 中。
SQL查询代码为:
`SELECT Industry_type, No_of_Employees, Employee_Insurance_Premium, Percent_Female_Employees FROM cdc_new
WHERE Industry_type= 'Hospitals' AND Employee_Insurance_Premium='Decreased'
ORDER BY Percent_Female_Employees DESC;`
这是我在 Pandas 中编写的代码:
pd.DataFrame(cdc_new[(cdc_new.Industry_type == 'Hospitals') & (cdc_new.Employee_Insurance_Premium == 'Decreased')][['No_of_Employees', 'Industry_type', 'Employee_Insurance_Premium', 'Percent_Female_Employees']].sort_values(['Percent_Female_Employees'], ascending=[False]))
我得到的输出只有标题,没有文本。
慕田峪4524236
慕村9548890
达令说
相关分类