Question: I am facing the following problem, I have a date `dd-mm-yyyy` and I need to convert it to `yyyy-MM-dd HH:mm` (i.e. with the given date and current hours and minutes). 

Example : 
Given date : `11-06-2014` , I should get `2014-06-11 09:30` 

```
 public String previousDateString(String dateString)
        throws ParseException {
    // Create a date formatter using your format string
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");

    // Parse the given date string into a Date object.
    // Note: This can throw a ParseException.
    Date myDate = dateFormat.parse(dateString);

    // Use the Calendar class to subtract one day
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(myDate);
    calendar.setTime(myDate);
    calendar.add(Calendar.DAY_OF_YEAR, -1);

    // Use the date formatter to produce a formatted date string
    Date previousDate = calendar.getTime();
    String result = dateFormat.format(previousDate);

    return result;
}   

```

I have tried this code but I am getting `2014-06-10 00:00`

Answer: 
For your full dataset, change the last step from `df['concatenated'] = df_1` to `df['concatenated'] = df_1.values` will solve the issue, I think it a bug and I am very sure I have seen it in SO before.

Or just: `df['concatenated'] = [':'.join(word for word in row if word is not np.nan) for row in rows]`
```
>>> d = {'Col_1' : pd.Series(['A', 'A', 'A', 'B']),
...      'Col_2' : pd.Series(['B', 'C', 'B', 'D']),
...      'Col_3' : pd.Series([np.nan, 'D', 'C', np.nan]),
...      'Col_4' : pd.Series([np.nan, np.nan, 'D', np.nan]),
...      'Col_5' : pd.Series([np.nan, np.nan, 'E', np.nan]),}
>>> df = pd.DataFrame(d)
>>> 
>>> rows = df.values
>>> df_1 = pd.DataFrame([':'.join(word for word in rows if word is not np.nan) for rows in rows])
>>> 
>>> df['concatenated'] = df_1[0]
>>> df
  Col_1 Col_2 Col_3 Col_4 Col_5 concatenated
0     A     B   NaN   NaN   NaN          A:B
1     A     C     D   NaN   NaN        A:C:D
2     A     B     C     D     E    A:B:C:D:E
3     B     D   NaN   NaN   NaN          B:D
>>> 

```