Output of Dataframe.info()

Hi,
Could someone explain what the “574 to 1061” means? The values in the index column are definitely wider ranging than that - have to be since there are 3000+ entries…

<class 'pandas.core.frame.DataFrame'>
Int64Index: 3723 entries, 574 to 1061
Data columns (total 19 columns):
host_response_rate      3289 non-null object
host_acceptance_rate    3109 non-null object
host_listings_count     3723 non-null int64
accommodates            3723 non-null int64
room_type               3723 non-null object
bedrooms                3702 non-null float64
bathrooms               3696 non-null float64
beds                    3712 non-null float64
price                   3723 non-null float64
cleaning_fee            2335 non-null object
security_deposit        1426 non-null object
minimum_nights          3723 non-null int64
maximum_nights          3723 non-null int64
number_of_reviews       3723 non-null int64
latitude                3723 non-null float64
longitude               3723 non-null float64
city                    3723 non-null object
zipcode                 3714 non-null object
state                   3723 non-null object
dtypes: float64(6), int64(5), object(8)
memory usage: 581.7+ KB
1 Like

Hi @ananth.ch,

574 is the first index in Int64Index and 1061 - the last index. They are not even the max and min values of the indices.

It seems that your Int64Index has many duplicated values. Most probably, you dropped some rows and didn’t reset the index afterwards.

To avoid this issue, just reset the index before calling df.info():

df.reset_index(drop=True)
df.info()

In this case, you will have correct numbers in df.info() output.

Hi ananth.ch

I guess you might have coded like this
dc_listings = dc_listings.loc[np.random.permutation(len(dc_listings))] dc_listings.info()
Hence the output:
image

You can check and see that 574 is the first index, and 1061 is the last index in the DataFrame, which is now a random form of the original dataset.

Hope its clear now.

Thanks.

Thanks. So it is the first and last rather than the min and max…

Yes, these are the index values of the first and last rows.