import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('/OneDrive/Desktop/UNI/Angew_SYS1/Projekt/2012_gwr_sprengelerg.csv', sep = ';', encoding='cp1252')
I have this big dataframe and i want to delete the index (0-2991).
with df1.reset_index(drop=True, inplace=True)
nothing changes
and with df.style.hide_index()
it removes the index but in the next step I where I use
dataframe = pd.DataFrame(columns=['stimm', "stimm2"])
dataframe["stimm"] = df.loc[df['ptname'] == 'SPÖ', 'stimmen']
dataframe["stimm2"] = df.loc[df['ptname'] == 'FPÖ', 'stimmen']
print(dataframe)
AttributeError: 'Styler' object has no attribute 'loc'
Does anyone know what to do?