'float' object cannot be interpreted as an integer error when usng python inside RstudioPython integer division yields floatPython Error: 'float' object cannot be interpreted as an integerKeras AttributeError: 'list' object has no attribute 'ndim'reticulate does not work with R-Data frame and fit() function from Python (TypeError: 'float' object cannot be interpreted as an integer)What are the arguments in function fit of keras?Error while doing reshapeInvalidArgumentError when running model.fit()IOError: [Errno 2] No such file or directory when training Keras modelNeural Network classification'Tensor' object has no attribute 'ndim'

Twelve Labours - #03 Golden Hind

Why are so many cities in the list of 50 most violent cities in the world located in South and Central America?

Does animal blood, esp. human, really have similar salinity as ocean water, and does that prove anything about evolution?

Is Jupiter bright enough to be seen in color by the naked eye from Jupiter orbit?

Is there any algorithm that runs faster in Mathematica than in C or FORTRAN?

Make a haystack (with a needle)

Ambiguity - Should it be "mindful of committing logical fallacies" or "mindful of not committing logical fallacies"?

What elements would be created in a star composed entirely of gold?

How can Edward Snowden be denied a jury trial?

I am particularly fascinated by the Chinese character that is pronounced SHIN & means faith or belief

What happens to extra attacks after you kill your declared target

Why did my abusive boss insist that I take an unpaid leave of absence when I tried to resign?

If 120 experts in 12 different fields were sent back 10,000 years, could they recreate the 21 century in 100 years?

Employer says they want Quality & Quantity, but only pays bonuses based on the latter

instead of pressurizing an entire spacesuit with oxygen could oxygen just pressurize the head and the rest of the body be pressurized with water?

How does kinetic energy work in braking a vehicle?

What is a Spaceman Word™?

What's a good strategy for offering low on a house?

Letters associated with prime numbers

How to inflict ESD-damage on a board?

What does “studies need to be taken with more than the usual grain of salt” mean?

How can an immortal member of the nobility be prevented from taking the throne?

Graphical method in linear programming

Did the Allies reverse the threads on secret microfilm-hiding buttons to thwart the Germans?



'float' object cannot be interpreted as an integer error when usng python inside Rstudio


Python integer division yields floatPython Error: 'float' object cannot be interpreted as an integerKeras AttributeError: 'list' object has no attribute 'ndim'reticulate does not work with R-Data frame and fit() function from Python (TypeError: 'float' object cannot be interpreted as an integer)What are the arguments in function fit of keras?Error while doing reshapeInvalidArgumentError when running model.fit()IOError: [Errno 2] No such file or directory when training Keras modelNeural Network classification'Tensor' object has no attribute 'ndim'






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















I am using newest version of R studio, 1.2.1335. I ma trying to use LSTM model using reticulate inside R script or PYthon inside Rmarkdown document, but both return an error.



First, my try with reticulate:



library(reticulate)
use_condaenv('my_env')


SAMPLES=10000
A = 0.7
B = 10000.0
AMPU = 0.2
AMPN = 0.08
LAG = 5

tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
set.seed(1)
c.unif <- runif(SAMPLES+LAG)
c.norm <- rnorm(SAMPLES+LAG)
y1 <- A*sin(B*tseq)+c.unif*AMPU
y2 <- A*sin(B*tseq)+c.norm*AMPN

data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

LEN = 8
SRATE = 1
STRIDE = 1
BATCH = 16

### TEST
np <- import("numpy")
keraspy <- import("keras")
pybuiltin <- import_builtins(convert = TRUE)

train_gen <- keraspy$preprocessing$sequence$TimeseriesGenerator(
data=data,
targets=trgt,
length=LEN,
sampling_rate = SRATE,
stride = STRIDE,
start_index = 1,
end_index = 9000,
shuffle = FALSE,
reverse = FALSE,
batch_size = BATCH
)

val_gen = keraspy$preprocessing$sequence$TimeseriesGenerator(
data=data,
targets=trgt,
length=LEN,
sampling_rate = SRATE,
stride= STRIDE,
start_index = 9001,
end_index = 10000,
shuffle = FALSE,
reverse = FALSE,
batch_size = BATCH
)


model = keraspy$models$Sequential()
model$add(keraspy$layers$Flatten(input_shape = c(pybuiltin$int(LEN), 2L)))
model$add(keraspy$layers$Dense(units = 32L, activation = "relu"))
model$add(keraspy$layers$Dense(units = 2L))

model$compile(optimizer = "rmsprop", loss = "mae")

stepsPerEpoch <- floor((train_gen$end_index - train_gen$start_index)/BATCH)
validationSteps <- floor((val_gen$end_index - val_gen$start_index)/BATCH)
model$fit_generator(
train_gen,
steps_per_epoch = pybuiltin$int(stepsPerEpoch),
epochs = pybuiltin$int(100),
validation_data = val_gen,
validation_steps = pybuiltin$int(validationSteps)
)


This return error mentioned in the title:



Error in py_call_impl(callable, dots$args, dots$keywords) : 
TypeError: 'float' object cannot be interpreted as an integer


I have also tried to estimate same model inside R notebook:



---
title: "R Notebook"
output: html_notebook
---

```r
SAMPLES=10000
A = 0.7
B = 10000.0
AMPU = 0.2
AMPN = 0.08
LAG = 5

tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
set.seed(1)
c.unif <- runif(SAMPLES+LAG)
c.norm <- rnorm(SAMPLES+LAG)
y1 <- A*sin(B*tseq)+c.unif*AMPU
y2 <- A*sin(B*tseq)+c.norm*AMPN

data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

LEN = 8
SRATE = 1
STRIDE = 1
BATCH = 16

```

```python
import numpy as np
from keras.preprocessing.sequence import TimeseriesGenerator
from keras.models import Sequential
from keras.layers import Dense
import keras
import math

train_gen = TimeseriesGenerator(
data=r.data,
targets=r.trgt,
length=r.LEN,
sampling_rate = r.SRATE,
stride = r.STRIDE,
start_index = 1,
end_index = 9000,
shuffle = False,
reverse = False,
batch_size = r.BATCH
)

val_gen = TimeseriesGenerator(
data= r.data,
targets = r.trgt,
length= r.LEN,
sampling_rate = r.SRATE,
stride= r.STRIDE,
start_index = 9001,
end_index = 10000,
shuffle = False,
reverse = False,
batch_size = r.BATCH
)

math.floor((train_gen.end_index - train_gen.start_index)/int(r.BATCH))
train_gen.end_index

model = Sequential()
model.add(keras.layers.Flatten(input_shape = (int(r.LEN), 2)))
model.add(Dense(32, activation = "relu"))
model.add(Dense(2))
model.compile(optimizer = 'rmsprop', loss = 'mae')
model.fit_generator(
train_gen,
steps_per_epoch = math.floor((train_gen.end_index - train_gen.start_index)/float(r.BATCH)),
epochs = 100,
validation_data = val_gen,
validation_steps = math.floor((val_gen.end_index - val_gen.start_index)/float(r.BATCH))
)
```


but I got the same error.



If I define numbers as integers in the last step, I get smae error:



model.fit_generator(
train_gen,
steps_per_epoch = int(561),
epochs = int(100),
validation_data = val_gen,
validation_steps = int(61)
)


This is my first time using python inside Rstudio. Not very promising...










share|improve this question
































    0

















    I am using newest version of R studio, 1.2.1335. I ma trying to use LSTM model using reticulate inside R script or PYthon inside Rmarkdown document, but both return an error.



    First, my try with reticulate:



    library(reticulate)
    use_condaenv('my_env')


    SAMPLES=10000
    A = 0.7
    B = 10000.0
    AMPU = 0.2
    AMPN = 0.08
    LAG = 5

    tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
    set.seed(1)
    c.unif <- runif(SAMPLES+LAG)
    c.norm <- rnorm(SAMPLES+LAG)
    y1 <- A*sin(B*tseq)+c.unif*AMPU
    y2 <- A*sin(B*tseq)+c.norm*AMPN

    data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
    trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

    LEN = 8
    SRATE = 1
    STRIDE = 1
    BATCH = 16

    ### TEST
    np <- import("numpy")
    keraspy <- import("keras")
    pybuiltin <- import_builtins(convert = TRUE)

    train_gen <- keraspy$preprocessing$sequence$TimeseriesGenerator(
    data=data,
    targets=trgt,
    length=LEN,
    sampling_rate = SRATE,
    stride = STRIDE,
    start_index = 1,
    end_index = 9000,
    shuffle = FALSE,
    reverse = FALSE,
    batch_size = BATCH
    )

    val_gen = keraspy$preprocessing$sequence$TimeseriesGenerator(
    data=data,
    targets=trgt,
    length=LEN,
    sampling_rate = SRATE,
    stride= STRIDE,
    start_index = 9001,
    end_index = 10000,
    shuffle = FALSE,
    reverse = FALSE,
    batch_size = BATCH
    )


    model = keraspy$models$Sequential()
    model$add(keraspy$layers$Flatten(input_shape = c(pybuiltin$int(LEN), 2L)))
    model$add(keraspy$layers$Dense(units = 32L, activation = "relu"))
    model$add(keraspy$layers$Dense(units = 2L))

    model$compile(optimizer = "rmsprop", loss = "mae")

    stepsPerEpoch <- floor((train_gen$end_index - train_gen$start_index)/BATCH)
    validationSteps <- floor((val_gen$end_index - val_gen$start_index)/BATCH)
    model$fit_generator(
    train_gen,
    steps_per_epoch = pybuiltin$int(stepsPerEpoch),
    epochs = pybuiltin$int(100),
    validation_data = val_gen,
    validation_steps = pybuiltin$int(validationSteps)
    )


    This return error mentioned in the title:



    Error in py_call_impl(callable, dots$args, dots$keywords) : 
    TypeError: 'float' object cannot be interpreted as an integer


    I have also tried to estimate same model inside R notebook:



    ---
    title: "R Notebook"
    output: html_notebook
    ---

    ```r
    SAMPLES=10000
    A = 0.7
    B = 10000.0
    AMPU = 0.2
    AMPN = 0.08
    LAG = 5

    tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
    set.seed(1)
    c.unif <- runif(SAMPLES+LAG)
    c.norm <- rnorm(SAMPLES+LAG)
    y1 <- A*sin(B*tseq)+c.unif*AMPU
    y2 <- A*sin(B*tseq)+c.norm*AMPN

    data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
    trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

    LEN = 8
    SRATE = 1
    STRIDE = 1
    BATCH = 16

    ```

    ```python
    import numpy as np
    from keras.preprocessing.sequence import TimeseriesGenerator
    from keras.models import Sequential
    from keras.layers import Dense
    import keras
    import math

    train_gen = TimeseriesGenerator(
    data=r.data,
    targets=r.trgt,
    length=r.LEN,
    sampling_rate = r.SRATE,
    stride = r.STRIDE,
    start_index = 1,
    end_index = 9000,
    shuffle = False,
    reverse = False,
    batch_size = r.BATCH
    )

    val_gen = TimeseriesGenerator(
    data= r.data,
    targets = r.trgt,
    length= r.LEN,
    sampling_rate = r.SRATE,
    stride= r.STRIDE,
    start_index = 9001,
    end_index = 10000,
    shuffle = False,
    reverse = False,
    batch_size = r.BATCH
    )

    math.floor((train_gen.end_index - train_gen.start_index)/int(r.BATCH))
    train_gen.end_index

    model = Sequential()
    model.add(keras.layers.Flatten(input_shape = (int(r.LEN), 2)))
    model.add(Dense(32, activation = "relu"))
    model.add(Dense(2))
    model.compile(optimizer = 'rmsprop', loss = 'mae')
    model.fit_generator(
    train_gen,
    steps_per_epoch = math.floor((train_gen.end_index - train_gen.start_index)/float(r.BATCH)),
    epochs = 100,
    validation_data = val_gen,
    validation_steps = math.floor((val_gen.end_index - val_gen.start_index)/float(r.BATCH))
    )
    ```


    but I got the same error.



    If I define numbers as integers in the last step, I get smae error:



    model.fit_generator(
    train_gen,
    steps_per_epoch = int(561),
    epochs = int(100),
    validation_data = val_gen,
    validation_steps = int(61)
    )


    This is my first time using python inside Rstudio. Not very promising...










    share|improve this question




























      0












      0








      0








      I am using newest version of R studio, 1.2.1335. I ma trying to use LSTM model using reticulate inside R script or PYthon inside Rmarkdown document, but both return an error.



      First, my try with reticulate:



      library(reticulate)
      use_condaenv('my_env')


      SAMPLES=10000
      A = 0.7
      B = 10000.0
      AMPU = 0.2
      AMPN = 0.08
      LAG = 5

      tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
      set.seed(1)
      c.unif <- runif(SAMPLES+LAG)
      c.norm <- rnorm(SAMPLES+LAG)
      y1 <- A*sin(B*tseq)+c.unif*AMPU
      y2 <- A*sin(B*tseq)+c.norm*AMPN

      data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
      trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

      LEN = 8
      SRATE = 1
      STRIDE = 1
      BATCH = 16

      ### TEST
      np <- import("numpy")
      keraspy <- import("keras")
      pybuiltin <- import_builtins(convert = TRUE)

      train_gen <- keraspy$preprocessing$sequence$TimeseriesGenerator(
      data=data,
      targets=trgt,
      length=LEN,
      sampling_rate = SRATE,
      stride = STRIDE,
      start_index = 1,
      end_index = 9000,
      shuffle = FALSE,
      reverse = FALSE,
      batch_size = BATCH
      )

      val_gen = keraspy$preprocessing$sequence$TimeseriesGenerator(
      data=data,
      targets=trgt,
      length=LEN,
      sampling_rate = SRATE,
      stride= STRIDE,
      start_index = 9001,
      end_index = 10000,
      shuffle = FALSE,
      reverse = FALSE,
      batch_size = BATCH
      )


      model = keraspy$models$Sequential()
      model$add(keraspy$layers$Flatten(input_shape = c(pybuiltin$int(LEN), 2L)))
      model$add(keraspy$layers$Dense(units = 32L, activation = "relu"))
      model$add(keraspy$layers$Dense(units = 2L))

      model$compile(optimizer = "rmsprop", loss = "mae")

      stepsPerEpoch <- floor((train_gen$end_index - train_gen$start_index)/BATCH)
      validationSteps <- floor((val_gen$end_index - val_gen$start_index)/BATCH)
      model$fit_generator(
      train_gen,
      steps_per_epoch = pybuiltin$int(stepsPerEpoch),
      epochs = pybuiltin$int(100),
      validation_data = val_gen,
      validation_steps = pybuiltin$int(validationSteps)
      )


      This return error mentioned in the title:



      Error in py_call_impl(callable, dots$args, dots$keywords) : 
      TypeError: 'float' object cannot be interpreted as an integer


      I have also tried to estimate same model inside R notebook:



      ---
      title: "R Notebook"
      output: html_notebook
      ---

      ```r
      SAMPLES=10000
      A = 0.7
      B = 10000.0
      AMPU = 0.2
      AMPN = 0.08
      LAG = 5

      tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
      set.seed(1)
      c.unif <- runif(SAMPLES+LAG)
      c.norm <- rnorm(SAMPLES+LAG)
      y1 <- A*sin(B*tseq)+c.unif*AMPU
      y2 <- A*sin(B*tseq)+c.norm*AMPN

      data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
      trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

      LEN = 8
      SRATE = 1
      STRIDE = 1
      BATCH = 16

      ```

      ```python
      import numpy as np
      from keras.preprocessing.sequence import TimeseriesGenerator
      from keras.models import Sequential
      from keras.layers import Dense
      import keras
      import math

      train_gen = TimeseriesGenerator(
      data=r.data,
      targets=r.trgt,
      length=r.LEN,
      sampling_rate = r.SRATE,
      stride = r.STRIDE,
      start_index = 1,
      end_index = 9000,
      shuffle = False,
      reverse = False,
      batch_size = r.BATCH
      )

      val_gen = TimeseriesGenerator(
      data= r.data,
      targets = r.trgt,
      length= r.LEN,
      sampling_rate = r.SRATE,
      stride= r.STRIDE,
      start_index = 9001,
      end_index = 10000,
      shuffle = False,
      reverse = False,
      batch_size = r.BATCH
      )

      math.floor((train_gen.end_index - train_gen.start_index)/int(r.BATCH))
      train_gen.end_index

      model = Sequential()
      model.add(keras.layers.Flatten(input_shape = (int(r.LEN), 2)))
      model.add(Dense(32, activation = "relu"))
      model.add(Dense(2))
      model.compile(optimizer = 'rmsprop', loss = 'mae')
      model.fit_generator(
      train_gen,
      steps_per_epoch = math.floor((train_gen.end_index - train_gen.start_index)/float(r.BATCH)),
      epochs = 100,
      validation_data = val_gen,
      validation_steps = math.floor((val_gen.end_index - val_gen.start_index)/float(r.BATCH))
      )
      ```


      but I got the same error.



      If I define numbers as integers in the last step, I get smae error:



      model.fit_generator(
      train_gen,
      steps_per_epoch = int(561),
      epochs = int(100),
      validation_data = val_gen,
      validation_steps = int(61)
      )


      This is my first time using python inside Rstudio. Not very promising...










      share|improve this question















      I am using newest version of R studio, 1.2.1335. I ma trying to use LSTM model using reticulate inside R script or PYthon inside Rmarkdown document, but both return an error.



      First, my try with reticulate:



      library(reticulate)
      use_condaenv('my_env')


      SAMPLES=10000
      A = 0.7
      B = 10000.0
      AMPU = 0.2
      AMPN = 0.08
      LAG = 5

      tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
      set.seed(1)
      c.unif <- runif(SAMPLES+LAG)
      c.norm <- rnorm(SAMPLES+LAG)
      y1 <- A*sin(B*tseq)+c.unif*AMPU
      y2 <- A*sin(B*tseq)+c.norm*AMPN

      data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
      trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

      LEN = 8
      SRATE = 1
      STRIDE = 1
      BATCH = 16

      ### TEST
      np <- import("numpy")
      keraspy <- import("keras")
      pybuiltin <- import_builtins(convert = TRUE)

      train_gen <- keraspy$preprocessing$sequence$TimeseriesGenerator(
      data=data,
      targets=trgt,
      length=LEN,
      sampling_rate = SRATE,
      stride = STRIDE,
      start_index = 1,
      end_index = 9000,
      shuffle = FALSE,
      reverse = FALSE,
      batch_size = BATCH
      )

      val_gen = keraspy$preprocessing$sequence$TimeseriesGenerator(
      data=data,
      targets=trgt,
      length=LEN,
      sampling_rate = SRATE,
      stride= STRIDE,
      start_index = 9001,
      end_index = 10000,
      shuffle = FALSE,
      reverse = FALSE,
      batch_size = BATCH
      )


      model = keraspy$models$Sequential()
      model$add(keraspy$layers$Flatten(input_shape = c(pybuiltin$int(LEN), 2L)))
      model$add(keraspy$layers$Dense(units = 32L, activation = "relu"))
      model$add(keraspy$layers$Dense(units = 2L))

      model$compile(optimizer = "rmsprop", loss = "mae")

      stepsPerEpoch <- floor((train_gen$end_index - train_gen$start_index)/BATCH)
      validationSteps <- floor((val_gen$end_index - val_gen$start_index)/BATCH)
      model$fit_generator(
      train_gen,
      steps_per_epoch = pybuiltin$int(stepsPerEpoch),
      epochs = pybuiltin$int(100),
      validation_data = val_gen,
      validation_steps = pybuiltin$int(validationSteps)
      )


      This return error mentioned in the title:



      Error in py_call_impl(callable, dots$args, dots$keywords) : 
      TypeError: 'float' object cannot be interpreted as an integer


      I have also tried to estimate same model inside R notebook:



      ---
      title: "R Notebook"
      output: html_notebook
      ---

      ```r
      SAMPLES=10000
      A = 0.7
      B = 10000.0
      AMPU = 0.2
      AMPN = 0.08
      LAG = 5

      tseq <- seq(0,0.1*pi,,(SAMPLES+LAG))
      set.seed(1)
      c.unif <- runif(SAMPLES+LAG)
      c.norm <- rnorm(SAMPLES+LAG)
      y1 <- A*sin(B*tseq)+c.unif*AMPU
      y2 <- A*sin(B*tseq)+c.norm*AMPN

      data <- cbind(y1[1:SAMPLES],y2[1:SAMPLES])
      trgt <- cbind(y1[LAG:(SAMPLES+LAG-1)],y2[LAG:(SAMPLES+LAG-1)])

      LEN = 8
      SRATE = 1
      STRIDE = 1
      BATCH = 16

      ```

      ```python
      import numpy as np
      from keras.preprocessing.sequence import TimeseriesGenerator
      from keras.models import Sequential
      from keras.layers import Dense
      import keras
      import math

      train_gen = TimeseriesGenerator(
      data=r.data,
      targets=r.trgt,
      length=r.LEN,
      sampling_rate = r.SRATE,
      stride = r.STRIDE,
      start_index = 1,
      end_index = 9000,
      shuffle = False,
      reverse = False,
      batch_size = r.BATCH
      )

      val_gen = TimeseriesGenerator(
      data= r.data,
      targets = r.trgt,
      length= r.LEN,
      sampling_rate = r.SRATE,
      stride= r.STRIDE,
      start_index = 9001,
      end_index = 10000,
      shuffle = False,
      reverse = False,
      batch_size = r.BATCH
      )

      math.floor((train_gen.end_index - train_gen.start_index)/int(r.BATCH))
      train_gen.end_index

      model = Sequential()
      model.add(keras.layers.Flatten(input_shape = (int(r.LEN), 2)))
      model.add(Dense(32, activation = "relu"))
      model.add(Dense(2))
      model.compile(optimizer = 'rmsprop', loss = 'mae')
      model.fit_generator(
      train_gen,
      steps_per_epoch = math.floor((train_gen.end_index - train_gen.start_index)/float(r.BATCH)),
      epochs = 100,
      validation_data = val_gen,
      validation_steps = math.floor((val_gen.end_index - val_gen.start_index)/float(r.BATCH))
      )
      ```


      but I got the same error.



      If I define numbers as integers in the last step, I get smae error:



      model.fit_generator(
      train_gen,
      steps_per_epoch = int(561),
      epochs = int(100),
      validation_data = val_gen,
      validation_steps = int(61)
      )


      This is my first time using python inside Rstudio. Not very promising...







      python r r-markdown rnotebook reticulate






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 21:38









      MislavMislav

      6395 silver badges21 bronze badges




      6395 silver badges21 bronze badges

























          0






          active

          oldest

          votes













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407239%2ffloat-object-cannot-be-interpreted-as-an-integer-error-when-usng-python-inside%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407239%2ffloat-object-cannot-be-interpreted-as-an-integer-error-when-usng-python-inside%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript