>
>
> >I was going to suggest the same thing: type casting can have
> >non-obvious effects, so explicit is better than implicit in this case.
>
> Aye. Did you mean to send this just to me and not the list?
>

nope -- I know i"m in the minority but i really wish lists had reply-to set
to the list.

Bringing it back on.

A pandas DataFrame comes with a conversion facility as a distinct
> method, but it only copes with some basic types (int, float), and most
> of the DataFrame operations expect homogenous data. In fact, I think a
> given column is always homongenous except for columns of type "object",
> but you can't do math operations with "object" columns - they tend to be
> labels and stuff like that.
>

Sure -- Pandas is built on top of numpy arrays -- which have always been
homogenous types -- which is quite deliberate -- numpy arrays provide three
things:

1) N-dimensionsl arrays -- very handy
2) fast vectorized computations
3) a nifty Python wrapper around C (or Fortran) arrays.

2 and 3 are only possible with homogeneous (fundamental) types.

The statistics module doesn't have the same limitations. But no matter how
you slide it, if the types are not homogenous, then there will be some loss
of some sort. Which is why I think it's better to make it explicit.

It's actually hard for me to imagine a case where someone would have mixed
types that wasn't an accident -- another reason to be explicit.

-CHB


-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/OTO5J5S6YPGWDWVW6SQCDUB4MX75J73V/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to