-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Index class ignores dtype parameter #235
Comments
This is intentional for now. The only two supported types are object and integer (int64) at the moment-- is it preventing you from doing something? You are actually the first person who's ever raised this as an issue. |
Not really, just something I noticed while trying (unsuccessfully) to Index a dataframe with floats. BTW, I just started using pandas a few days ago and love it, great job! |
Ah, gotcha. Well they'll still be floats inside the object array and lookups will work and all that. You know, it would be cool to make a Float64Index class- now that Int64Index has been done and integrated so it will play nice with object Indexes it should be largely a copy-paste job. I'll create a separate github issue about this and tag you in it |
Somehow i was completely ignorant of the fact that there are only two supported types (object and int64) for an index. from pandas/core/index.py Index class def is_numeric(self):
return issubclass(self.dtype.type, np.number) The only place this little method is used is in |
There is an inferred_type property that I'm using in the timeseries branch (b/c datetime64 is technically an int64), maybe can use this. |
|
Apparently Index always forces dtype to object, irrespective of what is specified as parameter.
Pandas 0.4.3
The text was updated successfully, but these errors were encountered: