When I run the following code in Jupyter 4.3.1 (Python 2.7.13)  import numpy as np for i in np.arange(5, 6, 0.1):     print(i)   I got the following output  5.0 5.1 5.199999999999999 5.299999999999999 5.399999999999999 5.499999999999998 5.599999999999998 5.6999999999999975 5.799999999999997 5.899999999999997   However, when I run the code in the console, I got the following output  5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9   Why does the Jupyter output differ from the console output?
27
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
4461
This prints 83  System.out.println(0123)   However this prints 123  System.out.println(123)   Why does it work that way?
44977
Please don't sign this as a duplicate of , they aren't. I am interested about the actual algorithm, not a proof of the existence.  Does a such mapping exists? I think, it must, because both of them have the same cardinality ($\aleph_1$).  My actual suggestion for a such mapping were simply merge the digits of the real numbers. For example, from $\pi$ and $e$ we could got  $3.1415...$ and $2.7182...$ would lead to $32.17411852...$ .  Although I am not sure it were ok. Maybe a better, clearer solution also exists?
96430
I'm trying to comprehend the following: If I choose any starting value (e.g. 1) and keep clicking on cosine on the calculator (in radian mode), it gives me a result of about 0.739085...(I believe it's the result of cos(x) = x), but when I repeat the same procedure using sin and tan, I get something completely different (looks like for sin it's converging to 0 while for tan I get very wild results).  Thanks for your help.
67567
I have a very large training set where each of the feature's datapoints are very similar (float values in the range 95.0 to 97.0) ?  For example, following is some part of the training data :  95.08273,94.13686,95.843,95.83886,95.38811,1 94.37234,93.47385,94.54948,94.67984,93.80062,1 94.02294,94.96799,95.075,95.41348,94.93842,1 95.1664,94.84861,94.82346,95.61005,96.62745,0 95.23271,94.87994,95.42258,95.48337,96.3997,0 93.77203,94.3065,94.33946,93.70812,93.42625,0 94.79427,94.70049,94.40502,94.61435,94.92593,1  where the last column is the class-label - only 0 and 1.  How should I handle this kind of data if the training set is very very large (> 100k) ?  Please suggest an appropriate classifier (using scikit-learn) as well.
45552
Example code:  (pc.cr &lt;- princomp(USArrests))   summary(pc.cr) loadings(pc.cr)  ## note that blank entries are small but not zero   I am getting different outputs from each, and I am not sure I understand what the difference is.  Here is the output:  &gt; summary(pc.cr) Importance of components:                            Comp.1      Comp.2      Comp.3       Comp.4 Standard deviation     82.8908472 14.06956001 6.424204055 2.4578367034 Proportion of Variance  0.9655342  0.02781734 0.005799535 0.0008489079 Cumulative Proportion   0.9655342  0.99335156 0.999151092 1.0000000000   &gt; loadings(pc.cr)  ## note that blank entries are small but not zero  ...                 Comp.1 Comp.2 Comp.3 Comp.4 SS loadings      1.00   1.00   1.00   1.00 Proportion Var   0.25   0.25   0.25   0.25 Cumulative Var   0.25   0.50   0.75   1.00   P.S: how can I get access to the table created by summary(pc.cr)?? (I can't seem to find it in str.)
1890
From the :  [1,4,9].map(Math.sqrt)   will yield:  [1,2,3]   Why then does this:  ['1','2','3'].map(parseInt)   yield this:  [1, NaN, NaN]   I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE).  I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of parseInt.  ['1','2','3'].map(function(i){return +i;}) // returns [1,2,3]
21860
I'm trying to debug a Python script by placing a print("foo=" + foo) statement in my code.  But where does the output appear?     It doesn't appear on the Python Console, and it doesn't appear on the area that appears when you drag the lower edge of the infobar downwards (what is the name for this area? My script errors show up in red here.)
43933
#include &lt;stdio.h&gt; int main() {     unsigned long long int num = 285212672; //FYI: fits in 29 bits     int normalInt = 5;     printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt);     return 0; }   Output:  My number is 8 bytes wide and its value is 285212672l. A normal number is 0.   I assume this unexpected result is from printing the unsigned long long int. How do you printf() an unsigned long long int?
76762
I have written a Python 3 code, which is:  i = int(input("enter number: ")) print("enter",i)   I'm expecting an output as:  enter number: 5 enter 5   However, I'm getting this:  enter number: 5 ('enter', 5)   What could be the issue? How can I rectify this?
8736
I'm trying to calculate the NDVI using raster calculator, but the result is integer instead of decimal.  NDVI = (NIR - RED)/(NIR + RED)   The result is normally in the range -1 to 1, but when i tried to calculate de result is -1, 0 and 1, and it does not have have any number in between like, -0.9 or 0.1. And i need those values so i can classify the result in term of soil occupation
31758
The documentation for the  function states that you pass it a number, and the positions past the decimal to round. Thus it should do this:  n = 5.59 round(n, 1) # 5.6   But, in actuality, good old floating point weirdness creeps in and you get:  5.5999999999999996   For the purposes of UI, I need to display 5.6. I poked around the Internet and found some  that this is dependent on my implementation of Python. Unfortunately, this occurs on both my Windows dev machine and each Linux server I've tried. .  Short of creating my own round library, is there any way around this?
17181
echo "scale=3;1/8" | bc   shows .125 on the screen. How to show 0.125 if the output result is less than one?
2900
It's supposed to be zero but for some reason the result produces a peculiar series of digits at the end.  Also, here's the .xlsx of it: http://83.212.111.36/Book1.xlsx
57093
I think there's a lot for me to learn about data types. Why this happens  double result = ((3/8)*100).ToString();   it gives zero .. should be 37,5 ... :(
67711
Is there a way to output for Print. I want to save in a higher DPI than the default 72dpi say 300dpi that's a good quality for printed pieces. I tried downloading an add-on but don't know if I am installing it correctly it isn't showing up but the bar in python is green. I'm using the 2.69 version of Blender. If no such feature exists what size have any of you found best for print quality. Thank you
114341
I have these observations $(2,3.2,3.8,2.5,3.3,2.8,3.0,3.4)$ from $X \sim N(\mu,\sigma^2)$ and i want to calculate the $P$-value testing $H_0: \mu =3.2$ against $H_1 \neq 3.2$ with $\sigma = 0.6$    should i calculate $P r(X &gt; 3.3) $ and $Pr( X &lt; 3)$ and add these togheter ?   I tried it using that  $X = Y\sigma + \mu  \sim N(0,1)$ but the answer don't seem to be right according to the solution which is $P = 0.347$   Anyone can tell me what Iam doing wrong?