python - 我怎样才能选择这个 ime 系列(径流)的 7 月份来绘制?
问题描述
我怎样才能挑选出这些时间序列的 7 月?我的时间序列从 1985 年到 2018 年,右侧是径流值。我需要获得更多代码的帮助,以挑选出 7 月的值,然后绘制它。我的代码:
从熊猫导入 read_csv
将 numpy 导入为 np
将 pandas 导入为 pd 将 matplotlib.pyplot 导入为 plt
导入操作系统
进口汽车
从日期时间导入日期,日期时间
dir1 =“神秘/”
文件 = os.listdir(dir1)
文件 = np.sort(文件)
files_txt = [i for i in files if i.endswith('.txt_')]
df = pd.read_csv(dir1+files_txt[0],skiprows=6,header=None, index_col=0,sep="",na_values=-9999)
df.index = pd.to_datetime(df.index,format="%Y%m%d/%H%M") parse_dates=True
index_col=0
myperiod = df["1985":"2018"]
我的例假
解决方案
推荐阅读
- pandas - 我怎样才能调整这个数据框索引?
- javascript - Chrome 扩展脚本在注入后不会执行
- assembly - 8086 masm,如何跳过输入对象文件名、源列表等,并使用 Notepad++ 在 DOSBox 中直接执行 asm 文件
- javascript - 来自浏览器的 Google Maps Place 请求
- c# - C# - 检查 DataAdapter 状态
- azure - 天蓝色函数 v 2.0 和密钥库
- node.js - Angular 6/Express 中的路由错误
- python-2.7 - 如何使用 python 下载谷歌电子表格?
- string - 搜索以小写开头后跟大写的字符串
- glsl - glsl 有一个错误:无法从“highp float”转换为“highp 3-component vector of float”