Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
import numpy as np
import csv as csv
def no_commas(num):
if num == '':
num = 0
else:
num = num.replace(',', '')
return float(num)
import matplotlib.pyplot as plt
import numpy as np
import csv as csv
def no_commas(num):
if num == '':
num = 0
else:
num = num.replace(',', '')
return float(num)
import csv
def social_data(var):
if var == '':
var = 0 # assigns value of zero when not present in scraped data
else:
var = var.replace(',', '') # replaces commas
return float(var) # converts string to float #No need to change any part of thise function
def clean_social_data(fin, n, o, p): #Multiple arguments? I need to read 3 different columns in the csv file at one time
import csv
def social_data(var):
if var == '':
var = 0 # assigns value of zero when not present in scraped data
else:
var = var.replace(',', '') # replaces commas
return float(var) # converts string to float #No need to change any part of thise function
def clean_social_data(fin, n, o, p): #Multiple arguments? I need to read 3 different columns in the csv file at one time