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

pandas: Cannot access member "astype" for type "float" #302

Closed
tekumara opened this issue Aug 31, 2020 · 1 comment
Closed

pandas: Cannot access member "astype" for type "float" #302

tekumara opened this issue Aug 31, 2020 · 1 comment
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@tekumara
Copy link

Environment data

  • Language Server version: Pylance language server 2020.8.3 (pyright 8c5415fd)
  • OS and version: macOS
  • Python version (& distribution if applicable, e.g. Anaconda): pandas==1.0.5

Expected behaviour

No type error

Actual behaviour

Cannot access member "astype" for type "float"
Member "astype" is unknown

Code Snippet / Additional information

import pandas as pd
from datetime import date


df = pd.DataFrame({
    'date': [
        date.fromisoformat('2020-02-14'),
        date.fromisoformat('2020-02-14'),
        date.fromisoformat('2020-03-14'),
    ],
    'amount': [50.0, 50.0, 12.0]
})

(df.groupby(["date"])["amount"]
 .sum()
 .astype(float)
 .to_frame(name="daily_total")
 .reset_index())
@judej judej added the bug Something isn't working label Aug 31, 2020
@github-actions github-actions bot removed the triage label Aug 31, 2020
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 14, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.9.5, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202095-16-september-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants