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

Transferring pandas dataframe to sheet not working as intended #116

Open
syomantak opened this issue Apr 16, 2020 · 4 comments
Open

Transferring pandas dataframe to sheet not working as intended #116

syomantak opened this issue Apr 16, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@syomantak
Copy link

syomantak commented Apr 16, 2020

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
Copy link

same here +1

@gionatamettifogo
Copy link

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
Copy link
Author

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

@ricklamers ricklamers added the enhancement New feature or request label Apr 27, 2020
@ricklamers
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants