pandas - 将行的所有元素转换为月份和年份的名称
解决方案
选择该行,对其进行操作以提取年份和月份名称,然后替换:
datetime = pd.to_datetime(df.iloc[3])
month_year = datetime.apply(lambda x: x.month_name() + ", " + str(x.year))
df.iloc[3] = month_year
推荐阅读
- azure - 有没有办法为 Azure AD B2C 租户中的单个用户启用/禁用多重身份验证?
- python - 使用 Pytesseract,我们如何从 OCR 中获取单词坐标作为输出?
- node.js - 如何在 Angular 8 中使用 nodejs 模块?
- magento2 - 在 magento admin 中添加产品时添加额外图像
- windows - SVN does not resolve symbolic link in the path of a file
- facebook - 如何在 facebook 中按页面获取今天发布的帖子?
- c# - 如何增加 HttpSys 将处理的并发请求数?
- php - 如何获取 json 中对象的值以进行一些操作并使用新的对象值重建 json?
- typescript - 如何从对象中选择一个值?
- angular - 以编程方式重新验证表单