OneHotEncoder returning array in the form of scientific notation - categorical-data

I am trying to convert my categorical features into numeric using the OneHotEncoder(). It is returning the array in scientific notation. I have somehow figured out the reason behind it. I might not have understood it completely but I am sure that it is happening because two of the columns are in float value(to be precise float64). What is the actual reason behind this? What are the conditions to get in such a form?
enter image description here

Related

Do we need standardization in K-prototypes algorithm

I want to use the K-prototype algorithm (a type of KNN algorithm used for mixed data :numerical and categorical data) for a clustering problem.
The algorithm handles the categorical values without numerical encoding, so I don't need to encode them to numerical values.
My question is : do we need to standardize the numerical columns before applying k-prototypes?
For example, I have the following columns: age(float), salary(float), gender(object), city(object), profession(object).
Do I need to apply standardization like this?
from sklearn.preprocessing import StandardScaler
scaled_X = StandardScaler().fit_transform(X[['salary', 'age']])
X[['salary', 'age']] = scaled_X
But I think that standardization has no value if it is not applied to all columns,because its goal is to make all variables on the same scale and not just some columns!
so in this case, we do not need to apply it!
I hope I explained my question well, Thank you.

Casting strings to numbers in App Inventor

The title is perhaps misleading but I don't know how this is called. I do want to know how to type cast for example an int variable to create a string image_number, where number is the value of that variable.
But the thing that bothers me the most is how to call for example an imageSprite with a string constructed in similar way.
I have 16 sprites in a list and some for loops, and have trouble calling sprites. I want to for example check whether that particular sprite has an image set. I know I can use the block that tells me whether that's the case or not, but I want to say:
if the number you are increasing is n, I want you to check whether imageSprite_n has an image set or not (without using if number == n, use imageSprite_n).
I hope my question is clear. Is there any way to do that or should this be done without a loop?
Learn how to work with lists
How to work with Lists by Saj
How to work with Lists and Lists of
lists (pdf) by appinventor.org
and learn how to use the advanced blocks
Then you can do it like this
The example uses 4 image sprites and checks, if image sprite 3 has an image set

Which format to use for image with floating point values?

For technical purpose I need to work with matrices gray level (images) containing floating point value that can exceed 1. (Example: 2.3324)
Which format should I use to store them in a file? I would like to avoid to bring them back to the range 0...1 when Matlab write them to disk.
I know I could just dump the matrix with save('myfile','myImage','-ascii') but I would like to use a graphical format
The FITS file format would be an option (http://en.wikipedia.org/wiki/FITS).
It has support in many languages, including MATLAB.
How about:
save('myFile','myImage')
That insures that you will not lose any data in conversion, and the underlying *.mat files are pretty efficient.

Expressing number in exponential format

We are working on a flex project
I need to display a number coming from a calculation in exponential format- essentially, show 80900 as 8.09* 10^4; 4.1e-4 as 4.1*10^-4 etc
Any simple way by which I can take the number and separate the exponent and the significand- without getting into string operations.
Try to look into Number.toExponential() method described here.
See if this helps:
"Let's create a custom formatter to
change a regular number format to an
exponential notation or a fixed-point
notation with two fractional digits"

What is the correct generic name for the data structure in a calculator app that holds the numeric display

It would hold a string and have characters (numeric, or decimal point) added and removed from the right end. Ignore the case of negative numbers for simplicity.
Does this kind of data structure have an agreed-upon name? Register? Buffer? Display? Something else?
UPDATE: This is an internal representation and may not be the final form of some calculation. It may be the inputs to some later calculation (after turning it into a number, of course).
You could implement it using a stack. A stack is last-in-first-out (LIFO), just like what you're describing with the display.
But if you're looking for something to name your calculation results, I'd agree with most of the answers that said "result" or "display". :-P
I wouldn't say there's an "agreed-upon" name; after all, I doubt there's a standards body whose job it is to review these things. That said, maybe you'll find one of these acceptable:
Answer
Result
Value
Digits
I think "Display" would make sense if you were describing it in real-world terms.

Resources