python - Python pandas,如何将特定的excel日期转换为json
问题描述
我有一个 excel 文件,想将 excel 转换为 json 文件。
这是我的擅长
1 Year Period 2 Year Period
Max 10% 11%
Period Jul 1996 to 1997 Jul 1997 to 1998
Min -30% -40%
Period mar 2002 to Mar 2003 mar 2003 to mar 2004
这是我想要的 Json 格式
"from": {
"month": 6,
"year": 1996
},
"to": {
"month": 6,
"year": 1997
}
问题是如何将“Period”行(例如 Jul 1996 到 1997)转换为 json 格式,例如
from": { "month": 6, "year": 1996 }, "to": { "month": 6, "year": 1997 }
解决方案
推荐阅读
- angular - 如何将修复标题添加到无法滚动的角度自动完成弹出窗口?
- puppeteer - 在 Puppeteer 中隐藏浏览器
- excel - VBA 中的引用列表中缺少 Microsoft MS Project XX.X 对象库引用
- ios - UIDatePicker setEnabled 只能在主线程中使用
- github - 是否有用于团队合作的本地 github?(不在云端)
- python - TensorFlow/Keras 多标签分类器
- nhibernate - NHibernate,子实体不延迟加载
- javascript - 未定义不是对象(评估 _this3.props.navigation.navigate)
- javascript - 如何在 Angular 中将 html 标签添加到 Quill 文本编辑器的内容 div?
- ajax - React/Redux 表单提交