You are close. Try:

dict.fromkeys(my_csv_dict.keys(),[])

This will initialize a dictionary with the same keys that you parsed from your CSV file, and each one will map to an empty list (to which, I assume, you will append your suspect row values).


Try this. (There are several subtler changes here that are all necessary, like how you can't initialize unsure_rows before you start reading the CSV.)

unsure_rows = None
for row in csv_reader:
#   if row['Start Time'] != 'None':
    try:
        if before_date > strptime(row['Start Time'], '%Y-%m-%d %H:%M:%S') > after_date:
            continue
    except ValueError:
        if not unsure_rows:
            # Initialize the unsure rows dictionary
            unsure_rows = dict.fromkeys(csv_reader.fieldnames,[])
        for key in unsure_rows:
            unsure_rows[key].append(row[key])
Answer from cheeken on Stack Overflow
🌐
W3Schools
w3schools.com › python › python_dictionaries_copy.asp
Python - Copy Dictionaries
Python Dictionaries Access Items Change Items Add Items Remove Items Loop Dictionaries Copy Dictionaries Nested Dictionaries Dictionary Methods Dictionary Exercises Code Challenge Python If...Else
Discussions

python - Copying a key/value from one dictionary into another - Stack Overflow
Is this copy by value or copy by reference? I ask because I really need to cut and paste the row from one dictionary to another, then once that row is in the new dict I need to add a key/value to that row (which is obviously a dict). More on stackoverflow.com
🌐 stackoverflow.com
How to copy one key pair value from one dictionary to another in python - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work More on stackoverflow.com
🌐 stackoverflow.com
Python copy specific key/value from one dictionary to another - Stack Overflow
0 copying values from one nested dictionary to another nested dictionary when key pairs are the same More on stackoverflow.com
🌐 stackoverflow.com
python - Moving a single key value pair from one dictionary to another - Stack Overflow
I'm working on building out a basic store in python, with a dictionary of items and their prices. I'm using a dictionary for the cart, and I want users to be able to add items to the cart. For this... More on stackoverflow.com
🌐 stackoverflow.com
December 25, 2018
🌐
GeeksforGeeks
geeksforgeeks.org › python-ways-to-copy-dictionary
Python | Ways to Copy Dictionary - GeeksforGeeks
December 30, 2022 - One additional approach to copying a dictionary is to use the built-in function deepcopy from the copy module. This function creates a deep copy of the dictionary, meaning that it creates a new dictionary object with new memory addresses for ...
🌐
AskPython
askpython.com › home › 4 easy ways to copy a dictionary in python
4 Easy Ways to Copy a Dictionary in Python - AskPython
April 6, 2023 - Similar to the case of the ... the change is reflected in the given dictionary dict1 too · We can use another Python dictionary copy method deepcopy() to copy a dictionary in Python....
🌐
Python Guides
pythonguides.com › python-dictionary-copy
How To Copy A Dictionary In Python?
August 19, 2025 - Dictionary comprehensions let me copy and filter keys in one go.
Find elsewhere
🌐
Educative
educative.io › answers › how-to-copy-a-dictionary-in-python
How to copy a dictionary in Python
There are several ways to make copies of dictionaries. A for loop can be used to iterate through the original dictionary and copy the elements into a new, empty dictionary one by one.
🌐
Toppr
toppr.com › guides › python-guide › references › methods-and-functions › methods › dictionary › copy › python-dictionary-copy
Python Dictionary copy(): Example of using copy() to copy Dictionaries
August 26, 2021 - When we use the copy() method, Python creates a completely new dictionary object to store a copy of the reference values from the original dictionary.
🌐
freeCodeCamp
freecodecamp.org › news › python-dictionary-guide
Python Dictionary Guide – How to Iterate Over, Copy, and Merge Dictionaries in Python 3.9
October 26, 2020 - The main difference between those two approaches is that the update() method adds the values of one dictionary to another and applies the changes directly. The resulting dictionary is not returned but actually saved into the first object. When you use the unpacking operators, on the other hand, you create a new dictionary and put the key-value pairs of the two dictionaries into it by unpacking them.
🌐
W3Schools
w3schools.com › python › gloss_python_copy_dictionary.asp
Python Copy a Dictionary
Python Overview Python Built-in ... Q&A Python Bootcamp Python Training ... You cannot copy a dictionary simply by typing dict2 = dict1, because: dict2 will only be a reference to dict1, and changes made in dict1 will automatically ...
🌐
Vultr Docs
docs.vultr.com › python › standard-library › dict › copy
Python dict copy() - Duplicate Dictionary | Vultr Docs
November 6, 2024 - The copy() method in Python provides a convenient way to create a shallow copy of a dictionary. It is ideal for duplicating dictionaries when the values are immutable or when changes to the values will not impact the original dictionary.
🌐
Reddit
reddit.com › r/python › dicts. moving a simple key and value from one dict to another.
r/Python on Reddit: Dicts. Moving a simple key and value from one dict to another.
August 29, 2015 -

Question's in the subject. The below is complete waffle.

--

Started learning Python recently. Im a digital compositor by trade (using nuke) Python seems to be the next logical step.

Let me start by saying I know nothing. And I'd prefer being pointed in the right direction rather than 'here's the answer'.

Below is my shitty, hacked to death code to try and make something similar to blackjack/21.

http://pastebin.com/RbkqJ0bc

Edit --

Turns out I was massively over complicating the whole thing. Lists seem to do what I want them to do.

http://pastebin.com/vhre3RdU

🌐
GeeksforGeeks
geeksforgeeks.org › python-dictionary-copy
Python Dictionary copy() - GeeksforGeeks
July 8, 2022 - import copy # Python program to demonstrate difference # between = and copy() original = {1: 'geeks', 2: 'for'} # copying using copy() function new = copy.deepcopy(original) # removing all elements from new list # and printing both new.clear() print('new: ', new) print('original: ', original) original = {1: 'one', 2: 'two'} # copying using = new = original # removing all elements from new list # and printing both new.clear() print('new: ', new) print('original: ', original) ... Python dictionary methods is collection of Python functions that operates on Dictionary.Python Dictionary is like a map that is used to store data in the form of a key: value pair.
🌐
Stack Overflow
stackoverflow.com › questions › 57726298 › how-to-copy-dictionary-object-value-from-one-key-to-another
python - How to copy dictionary object value from one key to another? - Stack Overflow
data = input() dict_ref = {} def is_int(s): try: int(s) return True except ValueError: return False while data != 'end': list_data = data.split('->') key = list_data[0].strip() values = list_data[1].split(',') for value in values: value = value.strip() if key not in dict_ref.keys() and is_int(value): dict_ref[key] = [value] elif key in dict_ref.keys() and is_int(value): dict_ref[key].append(value) else: ''' With Python dictionaries, when you assign a key to the value of another, the refresh is done automatically.
🌐
Python.org
discuss.python.org › ideas
Copy a dictionary, except some keys - Ideas - Discussions on Python.org
October 31, 2019 - How common is the need of getting a copy of a dict, except some of its keys? It happens to me quite frequently that I need a similar dict to what I have, but without some of its keys. Of course I can’t just remove the k…