Question: I have a short script which reads 1,048,574 records out of a CSV with two columns, and puts them into two lists, one for each column. So each list should end up with 1,048,574 elements.

In PyCharm, this works fine. In the console, the program hangs around 1,048,345.

I can't figure it out. Both are using the same Python, 3.6.5.

Here is the script:

```
import csv

xtime = []
voltage = []

count = 0
with open ('audio2.csv', newline='') as csvfile:
    reader = csv.reader(csvfile)
    for row in reader:
        xtime.append(row[0])
        voltage.append(row[1])
        print(count)
        count += 1
    print('finished reading')

```

Each line of the CSV looks like `-0.000951453,-1.56` and there are 1,048,574 lines. PyCharm prints `finished reading` at the end, but GitBash just hangs after printing `1048345`.

What could be the problem?

Answer: 
use the below line

```
this.dataSource = new MatTableDataSource(this.projects);

```

if paginator is still not working, for Dynamically loaded table data use `read` argument for MatPaginator

```
@ViewChild(MatPaginator, {read: true}) paginator: MatPaginator;

```

this will do the job.
Please try to initialize the MATPAGINATOR and MATSORT as follows and this worked for me.

```
public dataSource = new MatTableDataSource([]);
@ViewChild(MatSort) matSort: MatSort;

private paginator: MatPaginator;
private sort: any;

@ViewChild(MatPaginator) set matPaginator(mp: MatPaginator) {
    this.paginator = mp;
    this.setDataSourceAttributes();
  }

  @ViewChild(MatSort) set content(content: ElementRef) {
    this.sort = content;
    if (this.sort) {
      this.dataSource.sort = this.sort;
    }
  }

  setDataSourceAttributes() {
    this.dataSource.paginator = this.paginator;
    this.dataSource.sort = this.sort;
  }

```

Above code checks for the paginator and sort variables and will gets set when they are undefined.
Also no need to add #paginator in your HTML file.

Thanks and Regards,
Kishore Kumar. K