python - Series Index Pandas -
i have simple question. have series
[in]: item_series [out]: item_nbr 9 27396 28 4893 40 254 47 2409
now have loop
for j in item_series: print j
right prints: 27396, 4893, 254, 2409. how can print item number? in example: 9, 28, 40, 47.
you can access index of pandas series
using item_series.index
so example
for j in item_series.index: print j
Comments
Post a Comment