python - Change data type of columns in Pandas

You have four main options for converting types in pandas: to_numeric() - provides functionality to safely convert non-numeric types (e.g. strings) to a suitable numeric type. (See also to_datetim... Read More

sql - Return multiple fields as a record in PostgreSQL with PL/pgSQL

Don't use CREATE TYPE to return a polymorphic result. Use and abuse the RECORD type instead. Check it out: CREATE FUNCTION test_ret(a TEXT, b TEXT) RETURNS RECORD AS $$ DECLARE ret RECORD; BEGIN... Read More

types - In WebGL what are the differences between an attribute, a uniform, and a varying variable?

Copied directly from http://www.lighthouse3d.com/tutorials/glsl-tutorial/data-types-and-variables/. The actual site has much more detailed information and would be worthwhile to check out. Variable... Read More

Determining type of an object in ruby

The proper way to determine the "type" of an object, which is a wobbly term in the Ruby world, is to call object.class. Since classes can inherit from other classes, if you want to determine if an ob... Read More

types - Use of `inline` in F#

The inline keyword indicates that a function definition should be inserted inline into any code which uses it. Most of the time, this will not have any effect on the type of the function. However, in... Read More

Type of compiled regex object in python

Python 3.5 introduced the typing module. Included therein is typing.Pattern, a _TypeAlias. Starting with Python 3.6, you can simply do: from typing import Pattern my_re = re.compile('foo') assert is... Read More

Better way to get type of a Javascript variable?

Angus Croll recently wrote an interesting blog post about this - http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/ He goes through the pros and cons of the vario... Read More

SQL Server equivalent to MySQL enum data type?

It doesn't. There's a vague equivalent: mycol VARCHAR(10) NOT NULL CHECK (mycol IN('Useful', 'Useless', 'Unknown'))... Read More

types - Where is ptrdiff_t defined in C?

It's defined in stddef.h. That header defines the integral types size_t, ptrdiff_t, and wchar_t, the functional macro offsetof, and the constant macro NULL.... Read More

python - Test if a variable is a list or tuple

if type(x) is list: print 'a list' elif type(x) is tuple: print 'a tuple' else: print 'neither a tuple or a list'... Read More