-
Notifications
You must be signed in to change notification settings - Fork 44
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
Coerce function isn't columns-only #114
Comments
If using in other modules, should the "_" of |
Great question! Think about what def coerce(data, cast_to=numpy.float64):
if isinstance(data, pandas.DataFrame):
for column in data.columns:
data[column] = coerce(data[column], cast_to=cast_to)
return data
else:
try:
return data.astype(cast_to)
except:
return data |
Aha. This makes sense. Would it be a good idea to change
it might instead look like:
but Also, how do you get the syntax highlighting in this markdown? |
I'm OK defining things recursively in the pattern I've shown you. That, generally, is quite useful! Polymorphic functions are very good things, especially when they are quite general. I am happy to have wide-ranging changes that improve the library 😄
When you use three ticks for code blocks, put the name of the language you want to highlight in at the end of the three ticks. def do_something():
for i in range(1, n):
print(i) Julia: function do_something(n)
for i in 1:n
println(i)
end
end |
So, to make sure I'm comprehending, you're for the idea of changing def test():
print("Science!") Cooooooool. Thanks! |
yep! |
Is it valid to have the tuple |
yes! |
The _coerce function can take in multiple columns at once. The docstring and argument name (
column
vscolumns
) say it can only deal with a single column. Is this something that should be changed?The text was updated successfully, but these errors were encountered: