Skip to content

get_psm3() reorders the dataframe columns randomly #1647

Closed
@Arjannikov

Description

@Arjannikov

Every time I call get_psm3(), the returned data frame column order is different for the same query parameters.

CODE EXAMPLE

for count in range(3):
df, metadata = pvlib.iotools.get_psm3(
latitude=latitude, longitude=longitude,
api_key=NREL_API_KEY,
email=MY_EMAIL_ADDRESS
names=2019,
interval=60,
map_variables=True,
leap_day=True)
print(df.columns)

OUTPUT

Index(['Year', 'Month', 'Day', 'Hour', 'Minute', 'pressure', 'Dew Point', 'dni', 'ghi', 'dhi', 'albedo', 'temp_air', 'wind_speed', 'wind_direction'], dtype='object')

Index(['Year', 'Month', 'Day', 'Hour', 'Minute', 'Dew Point', 'pressure', 'wind_speed', 'dni', 'dhi', 'albedo', 'wind_direction', 'ghi', 'temp_air'], dtype='object')

Index(['Year', 'Month', 'Day', 'Hour', 'Minute', 'dhi', 'Dew Point', 'pressure', 'ghi', 'temp_air', 'wind_direction', 'dni', 'albedo', 'wind_speed'], dtype='object')

Versions:

  • pvlib.__version__: '0.9.4'
  • pandas.__version__: 1.5.3
  • python: sys.version_info(major=3, minor=9, micro=13, releaselevel='final', serial=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions