title: How to joint both the data that remain without NaN in Pandas Dataframe
body: <p>Now I am quite stuck with this coding. As mentions I am terrible at coding.
  Now, the problem with my code is it produce <code>Nan</code>. Which I think it is not suitable.
  Here are my coding and the problem that remains where I search a suitable coding.</p>
  <p>I called a part from my large data:</p>
  <pre><code>df1 =d1['hlogDs_dB'].str.split('[,:]',expand = True)
  df2 =d1['hlogUs_dB'].str.split('[,:]',expand = True)
  df1 =df1.astype(float)
  df2 =df2.astype(float)
  frames = [df1,df2]
  df = pd.concat(frames)
  df
  </code></pre>
  <p>Where I have to  dataframe Ds and Us. They have different numbers.</p>
  <pre><code>0   1   2   3   4   5   6   7   8   9   ... 674 675 676 677 678 679 680 681 682 683
  0   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -12.3   491.0   -12.5   492.0   -12.5   493.0   -12.6   494.0   -12.8
  1   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -8.5    491.0   -8.3    492.0   -8.3    493.0   -8.2    494.0   -8.2
  2   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -13.3   491.0   -13.6   492.0   -14.0   493.0   -14.2   494.0   -14.6
  3   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -11.5   491.0   -11.5   492.0   -11.7   493.0   -11.8   494.0   -12.0
  4   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.1    9.0 -2.0    ... 490.0   -13.5   491.0   -13.6   492.0   -13.8   493.0   -14.0   494.0   -14.5
  ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
  165 109.0   -5.2    110.0   -5.3    111.0   -5.5    112.0   -5.7    113.0   -5.9    ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  166 109.0   -5.5    110.0   -5.6    111.0   -5.8    112.0   -6.1    113.0   -6.3    ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  167 109.0   -6.0    110.0   -6.2    111.0   -6.4    112.0   -6.7    113.0   -7.1    ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  168 109.0   -5.4    110.0   -5.5    111.0   -5.7    112.0   -5.9    113.0   -6.2    ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  169 109.0   -5.9    110.0   -6.1    111.0   -6.4    112.0   -6.6    113.0   -7.0    ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
  340 rows × 684 columns
  </code></pre>
  <p>If seperately Ds</p>
  <pre><code>0   1   2   3   4   5   6   7   8   9   ... 674 675 676 677 678 679 680 681 682 683
  0   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -12.3   491.0   -12.5   492.0   -12.5   493.0   -12.6   494.0   -12.8
  1   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -8.5    491.0   -8.3    492.0   -8.3    493.0   -8.2    494.0   -8.2
  2   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -13.3   491.0   -13.6   492.0   -14.0   493.0   -14.2   494.0   -14.6
  3   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -11.5   491.0   -11.5   492.0   -11.7   493.0   -11.8   494.0   -12.0
  4   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.1    9.0 -2.0    ... 490.0   -13.5   491.0   -13.6   492.0   -13.8   493.0   -14.0   494.0   -14.5
  ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
  165 5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.1    9.0 -2.1    ... 490.0   -13.3   491.0   -13.5   492.0   -13.5   493.0   -13.6   494.0   -13.7
  166 5.0 -2.8    6.0 -2.7    7.0 -2.5    8.0 -2.5    9.0 -2.3    ... 490.0   -12.8   491.0   -13.0   492.0   -13.0   493.0   -13.1   494.0   -13.3
  167 5.0 -2.6    6.0 -2.5    7.0 -2.2    8.0 -2.2    9.0 -2.2    ... 490.0   -15.7   491.0   -15.5   492.0   -15.0   493.0   -14.7   494.0   -14.3
  168 5.0 -3.0    6.0 -3.0    7.0 -2.6    8.0 -2.5    9.0 -2.5    ... 490.0   -19.7   491.0   -20.3   492.0   -21.0   493.0   -21.5   494.0   -21.8
  169 5.0 -2.7    6.0 -2.5    7.0 -2.3    8.0 -2.2    9.0 -2.3    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  170 rows × 684 columns
  </code></pre>
  <p>Us:</p>
  <pre><code>0   1   2   3   4   5   6   7   8   9   ... 276 277 278 279 280 281 282 283 284 285
  0   109 -3.4    110 -3.4    111 -3.4    112 -3.5    113 -3.5    ... 343 -4.3    344 -4.3    345 -4.2    346 -4.2    347 -4.2
  1   109 -3.5    110 -3.5    111 -3.4    112 -3.4    113 -3.4    ... 343 -4.1    344 -4.2    345 -4.4    346 -4.4    347 -4.2
  2   109 -3.7    110 -3.7    111 -3.8    112 -3.8    113 -3.8    ... 343 -4.2    344 -4.3    345 -4.3    346 -4.3    347 -4.3
  3   109 -3.5    110 -3.6    111 -3.6    112 -3.6    113 -3.7    ... 343 -4.1    344 -4.1    345 -4.1    346 -4.1    347 -4.1
  4   109 -3.7    110 -3.8    111 -3.8    112 -3.8    113 -3.8    ... 343 -4.2    344 -4.2    345 -4.2    346 -4.2    347 -4.3
  ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
  165 109 -5.2    110 -5.3    111 -5.5    112 -5.7    113 -5.9    ... 343 -5.4    344 -5.3    345 -5.2    346 -5.1    347 -5.1
  166 109 -5.5    110 -5.6    111 -5.8    112 -6.1    113 -6.3    ... 343 -5.5    344 -5.4    345 -5.3    346 -5.2    347 -5.2
  167 109 -6.0    110 -6.2    111 -6.4    112 -6.7    113 -7.1    ... 343 -4.9    344 -4.9    345 -4.9    346 -4.9    347 -4.9
  168 109 -5.4    110 -5.5    111 -5.7    112 -5.9    113 -6.2    ... 343 -5.9    344 -5.7    345 -5.7    346 -5.6    347 -5.6
  169 109 -5.9    110 -6.1    111 -6.4    112 -6.6    113 -7.0    ... 343 -5.7    344 -5.7    345 -5.7    346 -5.6    347 -5.6
  170 rows × 286 columns
  </code></pre>
  <p>so now, I may do something to filled when the both combine</p>
  <pre><code>df= df.fillna(method='ffill',axis=0)
  df
  </code></pre>
  <p>result:</p>
  <pre><code>0   1   2   3   4   5   6   7   8   9   ... 674 675 676 677 678 679 680 681 682 683
  0   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -12.3   491.0   -12.5   492.0   -12.5   493.0   -12.6   494.0   -12.8
  1   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -8.5    491.0   -8.3    492.0   -8.3    493.0   -8.2    494.0   -8.2
  2   5.0 -2.1    6.0 -2.0    7.0 -1.8    8.0 -1.8    9.0 -1.8    ... 490.0   -13.3   491.0   -13.6   492.0   -14.0   493.0   -14.2   494.0   -14.6
  3   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.0    9.0 -2.0    ... 490.0   -11.5   491.0   -11.5   492.0   -11.7   493.0   -11.8   494.0   -12.0
  4   5.0 -2.5    6.0 -2.5    7.0 -2.1    8.0 -2.1    9.0 -2.0    ... 490.0   -13.5   491.0   -13.6   492.0   -13.8   493.0   -14.0   494.0   -14.5
  ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
  165 109.0   -5.2    110.0   -5.3    111.0   -5.5    112.0   -5.7    113.0   -5.9    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  166 109.0   -5.5    110.0   -5.6    111.0   -5.8    112.0   -6.1    113.0   -6.3    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  167 109.0   -6.0    110.0   -6.2    111.0   -6.4    112.0   -6.7    113.0   -7.1    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  168 109.0   -5.4    110.0   -5.5    111.0   -5.7    112.0   -5.9    113.0   -6.2    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  169 109.0   -5.9    110.0   -6.1    111.0   -6.4    112.0   -6.6    113.0   -7.0    ... 490.0   -16.2   491.0   -16.2   492.0   -16.2   493.0   -16.1   494.0   -16.0
  340 rows × 684 columns
  </code></pre>
  <p>I understand a little. Which I am wrong in understanding it. Can anyone suggest for me learning pandas that suitable for me analysis and make a programmable easily. I am quite down a bit with my limitations knowledge in pandas.</p>
  <p>My flow is like this:</p>
  <ol>
  <li>My code is to extract a columns that has many separator.</li>
  <li>After extract I split the data into columns that's why it contains and <code>int</code> number and <code>float</code> number.</li>
  <li>After that I want to combine the both Us and Ds data and sort number of <code>int</code> only that follow with the <code>float</code>.</li>
  <li>Then I use the new <code>dataframe</code> to equations that I will do.</li>
  <li>After that I want to plot the data.</li>
  </ol>
  <p>So basically that  is my process. I don't know what to search on google engine. Thank you.</p>