# Tag: precision

## How many times can you divide 24**36 by 2 until it becomes imprecise?

How many times can you divide 24**36 by 2 until it becomes imprecise? I had this question on one of my quizzes in a python course, and I’m curious as to what the correct answer is. (It’s already submitted so no cheating here) I wrote this small bit of code in python to calculate how many times you can evenly

## pd.read_csv() keep number of decimals

I want to read a csv but it culls the number of decimals: gives (first 2 rows, first five columns): enter image description here the original data (here) has 8 decimal places in the 3rd and 4th columns. I need those. 2211 196568.000 -25.732036008 28.282629130 1387.8994 2211 196569.000 -25.732032386 28.282633712 1389.4025 How do I read a csv and retain the

## Pytorch getting RuntimeError: Found dtype Double but expected Float

I am trying to implement a neural net in PyTorch but it doesn’t seem to work. The problem seems to be in the training loop. I’ve spend several hours into this but can’t get it right. Please help, thanks. I haven’t added the data preprocessing parts. (tensor([ 5., 5., 8., 14.], dtype=torch.float64), tensor(-0.3403, dtype=torch.float64)) Error: Answer You need the data

## Why do I lose numerical precision when extracting element from list in python?

I have a pandas dataframe that looks like this: data 0 [26.113017616106, 106.948066803935, 215.488217… 1 [26.369709448639, 106.961107298101, 215.558911… 2 [26….

## Printing 2 numbers before comma

I want to print numbers with precision to 2 digits before dot and 3 after. Example: will show: I know that will show me 3 digits after dot but how to get 2 digits before dot with 0 if that is shorter than 2 digits? Answer You can specify a total width for the output; if you include a leading