Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fields argument in Dataset.get_data makes non-selected columns NaN but all columns still present in DataFrame #280

Open
caelan-schneider opened this issue Nov 2, 2023 · 0 comments

Comments

@caelan-schneider
Copy link

caelan-schneider commented Nov 2, 2023

Describe the bug
Non-selected fields become NaN but all fields are still present in the dataframe - this is different from the example output in the docs.

To Reproduce
Run the code from the "Fields Selection" section of this page:

from gs_quant.data import Dataset
from datetime import date

weather_ds = Dataset('WEATHER')
data_frame = weather_ds.get_data(date(2016, 1, 1), date(2016, 1, 2), city=["Boston"], fields=['maxTemperature', 'minTemperature'])

print(data_frame)

Expected behavior
Returns:

     city        date  maxTemperature  minTemperature
0  Boston  2016-01-01            41.0            33.0
1  Boston  2016-01-02            40.0            31.0

Actual behavior
Returns:

              city  maxTemperature  minTemperature  dewPoint  windSpeed   
date                                                                      
2016-01-01  Boston            41.0            33.0       NaN        NaN  \
2016-01-02  Boston            40.0            31.0       NaN        NaN   

            precipitation  snowfall  pressure  updateTime  
date                                                       
2016-01-01            NaN       NaN       NaN         NaN  
2016-01-02            NaN       NaN       NaN         NaN  

Systems setup:

  • OS: Windows 10
  • Python version: 3.11
  • GS-Quant version: 1.0.44
@caelan-schneider caelan-schneider changed the title [BUG] fields argument in Dataset.get_data does nothing - all columns returned [BUG] fields argument in Dataset.get_data makes values NaN but all columns returned Nov 2, 2023
@caelan-schneider caelan-schneider changed the title [BUG] fields argument in Dataset.get_data makes values NaN but all columns returned [BUG] fields argument in Dataset.get_data makes non-selected columns NaN but all columns still present in DataFrame Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant