title: In Pandas, how to return 2 data using resample('D').first()?
body: <h2> Questions </h2>
  
  <ul>
  <li>Q1. Why does the <code>float</code> data changes to <code>string</code> data when it gets put into a <code>pd.dataframe</code>? Is there any way to keep it float, rather than changing it to float afterwards with <code>.astype(float)</code>?</li>
  <li>Q2. How to get 2 data using <code>resample('D').first()</code> method? The method <code>.first()</code> returns only 1 data, while I want 2 data to be returnd. : If it is not possible with <code>.first()</code> method, can you give me an alternative solution?</li>
  </ul>
  
  <h2> Code Example </h2>
  
  <pre><code>import pandas as pd
  import numpy as np
  from datetime import datetime
  
  BTC_df = pd.DataFrame(np.array([[1.05,'BTC'],[1.2,'BTC'],[0.9,'BTC']]),
                        columns = ['return','coin'],
                        index = [datetime(2020,5,1,15), datetime(2020,5,2,9,20), datetime(2020,5,3,23,40)])
  
  ETH_df = pd.DataFrame(np.array([[1.1,'ETH'],[0.9,'ETH'],[0.95,'ETH']]),
                        columns = ['return','coin'],
                        index = [datetime(2020,5,1,8,30), datetime(2020,5,2,17,30), datetime(2020,5,3,11,50)])
  
  EOS_df = pd.DataFrame(np.array([[1.3,'EOS'],[0.6,'EOS'],[0.8,'EOS']]),
                        columns = ['return','coin'],
                        index = [datetime(2020,5,1,1,20), datetime(2020,5,2,22,10), datetime(2020,5,3,13,5)])
  
  BTC_df
  &gt;&gt;&gt;                  return  coin
  2020-05-01 15:00:00   1.05   BTC
  2020-05-02 09:20:00   1.2    BTC
  2020-05-03 23:40:00   0.9    BTC
  
  ##############################################
  # Q1. Why does the 'float' changes to 'str'? #
  ##############################################
  BTC_df.loc[datetime(2020,5,2,9,20),'return']
  &gt;&gt;&gt;   '1.2'
  
  merged_df = pd.concat([BTC_df,ETH_df,EOS_df])
  merged_df.loc[:,'return'] = merged_df.loc[:,'return'].astype(float)  # from 'str' to 'float'
  merged_df.loc[:,'time'] = merged_df.index.time  # to preserve hour and minutes
  
  #################################################################
  # Q2. How to create the 'desired output' using resample method? #
  #################################################################
  merged_df.resample('D').first()
  &gt;&gt;&gt;        return  coin     time
  2020-05-01  1.30    EOS   01:20:00
  2020-05-02  1.20    BTC   09:20:00
  2020-05-03  0.95    ETH   11:50:00
  
  </code></pre>
  
  <p>My desired output is as follows, showing 2 coins with the earliest time : </p>
  
  <pre><code>desired_output_df
  &gt;&gt;&gt;         return  coin    time
  2020-05-01  1.30    EOS   01:20:00
              1.10    ETH   08:30:00
  2020-05-02  1.20    BTC   09:20:00
              0.90    ETH   17:30:00
  2020-05-03  0.95    ETH   11:50:00
              0.80    EOS   13:05:00
  </code></pre>