For example, in my dataframe I have a column of NULL values that I plan to edit later, let's say for letter grades. Here is some example for now:
import csv
import pandas as pd
import numpy as np
df = pd.read_csv('MOCK_DATA.csv')
df.head()
id first_name last_name email null field blank_field
0 1 Paule Tohill ptohill0@macromedia.com False NaN
1 2 Rebe Slyford rslyford1@washington.edu True NaN
2 3 Angelita Antoni aantoni2@google.pl False NaN
3 4 Giffy Dehm gdehm3@berkeley.edu False NaN
4 5 Rob Beadle rbeadle4@taobao.com False NaN
I want to import the data to later change the blank_field
column's type. I understand how to use SQLAlchemy with the Python connector.
df.to_sql(con=con, name='Grades', if_exists='replace', flavor='mysql')
Do I need to specify anything here to change the blank_field
-column? How will Snowflake handle the NaN values?