Skip to main content
added 2 characters in body
Source Link
Anthon
  • 78.2k
  • 35
  • 207
  • 290

FACTOR is the name of the index - you shouldn't worry abutabout it - it doesn't affect your data:

In [78]: df
Out[78]:
              DATE  REVENUE  COST  POSITION
FACTOR
10      2017/01/01     1000   900        10
11      2017/01/01      900   700         9
12      2017/01/01     1100   800         7

In [79]: df.index.name
Out[79]: 'FACTOR'

If you want to rename it or to get rid of it (preserving the index values) you can use DataFrame.rename_axis() methdmethod:

In [80]: df = df.rename_axis(None)

In [81]: df
Out[81]:
          DATE  REVENUE  COST  POSITION
10  2017/01/01     1000   900        10
11  2017/01/01      900   700         9
12  2017/01/01     1100   800         7

In [82]: df.index.name is None
Out[82]: True

FACTOR is the name of the index - you shouldn't worry abut it - it doesn't affect your data:

In [78]: df
Out[78]:
              DATE  REVENUE  COST  POSITION
FACTOR
10      2017/01/01     1000   900        10
11      2017/01/01      900   700         9
12      2017/01/01     1100   800         7

In [79]: df.index.name
Out[79]: 'FACTOR'

If you want to rename it or to get rid of it (preserving the index values) you can use DataFrame.rename_axis() methd:

In [80]: df = df.rename_axis(None)

In [81]: df
Out[81]:
          DATE  REVENUE  COST  POSITION
10  2017/01/01     1000   900        10
11  2017/01/01      900   700         9
12  2017/01/01     1100   800         7

In [82]: df.index.name is None
Out[82]: True

FACTOR is the name of the index - you shouldn't worry about it - it doesn't affect your data:

In [78]: df
Out[78]:
              DATE  REVENUE  COST  POSITION
FACTOR
10      2017/01/01     1000   900        10
11      2017/01/01      900   700         9
12      2017/01/01     1100   800         7

In [79]: df.index.name
Out[79]: 'FACTOR'

If you want to rename it or to get rid of it (preserving the index values) you can use DataFrame.rename_axis() method:

In [80]: df = df.rename_axis(None)

In [81]: df
Out[81]:
          DATE  REVENUE  COST  POSITION
10  2017/01/01     1000   900        10
11  2017/01/01      900   700         9
12  2017/01/01     1100   800         7

In [82]: df.index.name is None
Out[82]: True
Source Link
MaxU - stand with Ukraine
  • 211.7k
  • 37
  • 402
  • 436

FACTOR is the name of the index - you shouldn't worry abut it - it doesn't affect your data:

In [78]: df
Out[78]:
              DATE  REVENUE  COST  POSITION
FACTOR
10      2017/01/01     1000   900        10
11      2017/01/01      900   700         9
12      2017/01/01     1100   800         7

In [79]: df.index.name
Out[79]: 'FACTOR'

If you want to rename it or to get rid of it (preserving the index values) you can use DataFrame.rename_axis() methd:

In [80]: df = df.rename_axis(None)

In [81]: df
Out[81]:
          DATE  REVENUE  COST  POSITION
10  2017/01/01     1000   900        10
11  2017/01/01      900   700         9
12  2017/01/01     1100   800         7

In [82]: df.index.name is None
Out[82]: True