1

I'm using a notebook on Python 3 to generate a list with a dataset of 200 observations. Every time I run it, the kernel disconnects with the error message: "The kernel for Desktop/Untitled2.ipynb appears to have died. It will restart automatically." The code I am using is:

early_congress = []
late_congress = []
import csv
import pandas as pd
import statistics
with open('bills.csv', 'r') as bill_file:
    fieldnames = ['bill_number', 'congress', 'bill_title', 'bill_subtitle']
    csv_reader = csv.DictReader(bill_file, delimiter = ',', skipinitialspace=True, 
                               fieldnames = fieldnames)
    for row in bill_file:
        if ['congress'] == '104th':
            early_congress.append('bill_subtitle', 'bill_number', 'congress')
            for row in early_congress:
                total_count = early_congress['bill_subtitle'].count
                print(total_count + 1)

I'm relatively new to Python so my understanding of how it operates is relatively new. I tried reinstalling Jupyter which didn't seem to change it. When this happens, what should I look for and is there a way to troubleshoot?

1 Answer 1

1

When a kernel dies, it often means you have overloaded your notebook's alotted memory. this can be resolved by changing your jupyter notebook configuration to allow more RAM, or by breaking memory-intensive tasks into multiple blocks.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.