# How to concatenate epochs with different lengths and/or time

**URL:** <https://mne.discourse.group/t/how-to-concatenate-epochs-with-different-lengths-and-or-time/4341>\
**Category:** Support & Discussions\
**Created:** [February 1, 2022, 1:52am UTC](https://mne.discourse.group/t/how-to-concatenate-epochs-with-different-lengths-and-or-time/4341 "2022-02-01T01:52:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![FrancoisThiffault](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/francoisthiffault/32/1149_2.png) [@FrancoisThiffault](https://mne.discourse.group/u/FrancoisThiffault)\
**Post date:** [February 4, 2022, 1:43pm UTC](https://mne.discourse.group/t/how-to-concatenate-epochs-with-different-lengths-and-or-time/4341/3 "2022-02-04T13:43:37Z")

</div>

Thanks for your answer Alex.

Here’s what I did to solve my problem. Maybe the solution could help other people.

- Export MNE epochs as numpy array using `epochs_trial.get_data`
- Use `numpy.concatenate` to concatenate them. That function enables concatenation with arrays of different lengths.
- Create a new MNE epoch with the numpy array using `mne.EpochsArray`.

François

---

_[View the full topic](https://mne.discourse.group/t/how-to-concatenate-epochs-with-different-lengths-and-or-time/4341)._
