Comments (2)
import numpy as np
import pandas as pd
i = np.array([1.0, 2.0])
pd.DataFrame([[1.0, 2.0],[3.0,4.0]], columns=["a","b"], index=i) # mypy error
Error is
Argument "index" to "DataFrame" has incompatible type "ndarray[Any, dtype[Any]]"; expected "Union[Index, Series[Any], List[Any], Dict[Any, Any], range, None]"
from pandas-stubs.
We can't use Sequence
, because Sequence[str]
matches a single string, but can add np.ndarray
from pandas-stubs.
Related Issues (20)
- pd.to_datetime(list[datetime.date]) is wrong input type (mypy), but pandas returns output. HOT 2
- Pandas concat incorrectly marks subsequent code as unreachable HOT 1
- pandas.DataFrame.from_dict : issue with dtype and columns arguments types HOT 2
- Problem accessing `.loc` with tuple for MultiIndex Series HOT 3
- concat still reports unreachable for Iterable[None|Any] corner case HOT 11
- register_dataframe_accessor causes "Untyped class decorator obscures type of class; ignoring decorator" HOT 2
- Return type of pipe not consistent with types at run time HOT 7
- README.md still suggests to join a gitter room HOT 1
- VSCode questions HOT 6
- Use the new TypeIs feature to update the notna/notnull/isna/isnull type guards
- Passing a callable to DataFrame.mask's 'cond' argument results in arg-type error (mypy) HOT 2
- No overload variant of "apply" of "Styler" matches argument types "Callable[[Series[int], str], list[str]]", "str", "int" HOT 2
- Stack method - Unexpected keyword argument HOT 2
- Allow 'integer' in select_dtypes include argument HOT 1
- Unexpected, Misleading mypy Failures After pandas-stubs Update: DataFrame.from_dict() Behavior HOT 5
- Should from_dict be annotated to allow sequence data values? HOT 8
- Index.rename() should return Self HOT 3
- Annotation of `get_loc` does no longer fit to `iloc` resulting in many false positive type errors. HOT 2
- Can't pass `dict` to `DataFrame.apply` HOT 1
- `Series.map()` needs type for `arg` and result HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas-stubs.