这段代码之前可以工作,但是,在创建新环境后,它停止为该行工作
plt.xticks(x, months, rotation=25,fontsize=8)
Run Code Online (Sandbox Code Playgroud)
如果我注释此行,则没有错误,放置此行后会抛出错误
ValueError: The number of FixedLocator locations (5), usually from a call to set_ticks, does not match the number of ticklabels (12).
Run Code Online (Sandbox Code Playgroud)
import numpy as np
import matplotlib.pyplot as plt
dataset = df
dfsize = dataset[df.columns[0]].size
x = []
for i in range(dfsize):
x.append(i)
dataset.shape
# dataset.dropna(inplace=True)
dataset.columns.values
var = ""
for i in range(dataset.shape[1]): ## 1 is for column, dataset.shape[1] calculate length of col
y = dataset[dataset.columns[i]].values
y = y.astype(float)
y = y.reshape(-1, 1)
y.shape …Run Code Online (Sandbox Code Playgroud)