title: Convert float value to integers in Pandas dataframe while ignoring null values
body: <p>I have a two seperate csv files I read into a pandas dataframe. I've already done a bit of cleaning and joined the tables by their date column. I have another column called 'ExerciseTime' and converted the imported time format of the time of day exercise was performed to a float format i.e. 22:30:00 (10:30 pm) to 22.5 (float value). </p>
  
  <p>I am wanting to run train/test split analysis by comparing exercise time of day to quality of sleep (this is my Garmin connect data and Sleep cycle data). Currently there is very little accuracy/correlation but I suspect if I make the 'ExerciseTime' column into dummy variables by hour it may help. I am wanting to convert all values in the column to integer values (rounding up and down) and want to ignore any instances where there are nulls (days I didn't exercise). I currently am getting an error when I use the following formula:</p>
  
  <pre><code>JoinedTables = JoinedTables[JoinedTables.ExerciseTime.astype(int)]
  </code></pre>
  
  <p>What would be the best way to ignore the nulls and convert the float values to integers? </p>
  
  <p>Also, if anyone knows of the best type model predictors to use on this type of data I would appreciate any ideas as I'm still new to this. I have other data points like "Total Exercise Duration", "If I consumed Alcohol before bed", "Type of Exercise that day", "Moon Phase that Day" that I would like to incorporate as well and see if there is any statistically significant impact on my sleep quality. </p>