0

how do i modify my series to give the out i want?

dfloss['net'].head()

Output was

2326   -99275.0
3795   -1900853.0
3857   -1589759.0
3941   -1234893.0
4038   -1992320.0
Name: net, dtype: float64

the output i want is

-99275.0
-1900853.0
-1589759.0
-1234893.0
-1992320.0
Name: net, dtype: float64
  • 1
    Pandas series always have indexes. You can use `series.reset_index(drop=True)` to have the default range index. Or see [this question](https://stackoverflow.com/questions/24644656/how-to-print-pandas-dataframe-without-index) if you only want to print the series without index. – Quang Hoang Oct 24 '19 at 14:04

1 Answers1

0

As @Quang Hoang said in their reply, pandas Series (and DataFrames) always have indices. You can easily access the not explicitly indexed underlying numpy-array via the .values attribute though.

If you're just concerned about the output, try something like this:

for x in df.values:
    print(x)

If you just want the first few, you can slice the .values array like any other:

for x in df.values[:5]:
    print(x)
molybdenum42
  • 343
  • 1
  • 9