我有大文件,当我修改此文件时,我尝试保存文件,但终端显示错误。
import pandas as pd
from pandas import DataFrame
import matplotlib.pyplot as plt
import numpy as np
def modifydataset():
df = pd.read_csv('/home/najeeb/Downloads/stocks_sentdex.csv')
df['time'] = pd.to_datetime(df['time'], unit='s')
df = df.set_index('time')
del df['id']
df.to_csv('stocks_sentdex.csv')
modifydataset()
错误显示在终端中:
File "/home/najeeb/PycharmProjects/pandaplotaa.py", line 16
df.to_csv('stocks_sentdex.csv')
^
IndentationError: unindent does not match any outer indentation level