![]() ![]() ![]() I am fairly new to python and pandas, so I apologize for any inconvenience. Would anyone know how to prevent this column of data to be listed as an index? I would like to have the index just +1 increasing integers. The Index values in my output are actually the first column of data in the file, which is then moving all the rest of the data to the left by one. ![]() Index: 10 entries, C00410118 to C00410118Īnd here is the book's output (again with data columns excluded): In : fec = read_csv('P00000001-ALL.csv') To keep it short I am excluding the data column outputs, but here is my output (please not the Index values): In : fec Here is the loading code (to save time in the checking, I set the nrows=10): import pandas as pdįec = pd.read_csv('P00000001-ALL.csv',nrows=10,index_col=None) The trouble is that one of the columns of data is always being set as the index column, even when the index_col argument is set to None. I am going through the 'Python for Data Analysis' book and having trouble in the 'Example: 2012 Federal Election Commision Database' section reading the data to a DataFrame. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |