Skip to content
Advertisement

Tag: type-conversion

converting a set() to an int python

So my question is how can you (or if it can be done at all) convert data type of set to an integer? for example: (IS A TOY EXAMPLE TO EXPLAIN WHAT I’M TRYING TO DO) Output: <class ‘int’> So any assistance in the conversion of a set() to an int would be greatful. I have seen this how-can-i-convert-a-set-of-numeric-strings-to-a-set-of-integers which

Converting pandas.DataFrame to bytes

I need convert the data stored in a pandas.DataFrame into a byte string where each column can have a separate data type (integer or floating point). Here is a simple set of data: and df looks something like this: The DataFrame knows about the types of each column df.dtypes so I’d like to do something like this: This typically works

Advertisement