ricklamers / gridstudio

Grid studio is a web-based application for data science with full integration of open source data science frameworks and languages.
GNU Affero General Public License v3.0
8.88k stars 1.5k forks source link

Transferring pandas dataframe to sheet not working as intended #116

Open syomantak opened 4 years ago

syomantak commented 4 years ago

I am basically just doing whatever the author of this blog has done but somehow I am running into a weird error. The data frame has about 108 rows but when I do sheet("A1", df_oz, headers=True), it sort of warps after 100 rows! Attaching a screenshot and the code.

df = pd.read_csv("https://opendata.ecdc.europa.eu/covid19/casedistribution/csv").dropna()
print(df.head())
print(list(df))
print(df['geoId'])
print(df['countryterritoryCode'])

df.dateRep = pd.to_datetime(df.dateRep, format='%d/%m/%Y').dt.strftime('%Y%m%d').astype(int)
print(df.dateRep)

df_oz = df[df.countriesAndTerritories == 'Australia']
print(df_oz.head())

df_oz = df_oz[['dateRep', 'cases', 'deaths']]
df_oz = df_oz.sort_values('dateRep')
print(df_oz.head())

df_oz['cumCases'] = df_oz.cases.cumsum()
df_oz['cumDeaths'] = df_oz.deaths.cumsum()

print(df_oz)
sheet("A1", df_oz, headers=True)

I think rows over 100 isn't supported. I get desired output when I do df_oz = df_oz[:99].

Selection_004

hanishche commented 4 years ago

same here +1

gionatamettifogo commented 4 years ago

You can work around this problem by right clicking in the worksheet then picking "Change sheet size" and making the worksheet larger, see screenshot:

Screen Shot 2020-04-20 at 16 34 30

Seems like a bug, correct behavior would probably be to auto resize.

syomantak commented 4 years ago

@gionatamettifogo Yea that works, thanks. I hope the auto resize feature is included, otherwise it can get pretty tedious for large datasets! @ricklamers

ricklamers commented 4 years ago

@CyanideBoy I'll leave this issue open as enhancement suggestion! I agree, it should be easier.