TypeError:“函数”对象不可下标。这是我的错误

时间:2019-01-11 08:45:50

标签: python-3.x pandas time-series

我正在尝试创建一个时间序列模型以预测少量值。但是,每当我尝试读取文件时,都会出现错误。 粗体和斜体线产生错误。 这是我的代码:

import warnings
import itertools
import numpy as np
import matplotlib.pyplot as plt
warnings.filterwarnings("ignore")
plt.style.use('fivethirtyeight')
import pandas as pd
import statsmodels.api as sm
import matplotlib

matplotlib.rcParams['axes.labelsize'] = 14
matplotlib.rcParams['xtick.labelsize'] = 12
matplotlib.rcParams['ytick.labelsize'] = 12
matplotlib.rcParams['text.color'] = 'k'

***df = pd.read_csv["forecasting.csv", ","]***
t1 = df.loc[df['Technology'] == 't_1']

1 个答案:

答案 0 :(得分:0)

使用圆括号-(和),而不是方括号[和],即

df = pd.read_csv("forecasting.csv", ",")