Skip to content

Tag: pandas

How To Prevent Fast Execute Many Giving Truncation Error

Not sure how to reproduce this as I’m not sure what is causing the issue in the first place, however, I have the currently line of code which writes data to an SQL Server Table. However I get the following error: I have checked the sql server and see that varchar has been set to -1 which indicates that …

Struggles with converting a DBF file to Pandas DataFrame

I’m attempting to work with the Canadian radio station DBF files made public here: https://sms-sgs.ic.gc.ca/eic/site/sms-sgs-prod.nsf/eng/h_00015.html I’d like to read specifically the fmstatio.dbf file into a Pandas DataFrame. I’ve tried the two commonly recommended DBF packages in Python. …

Calculating hamming distance in a given year

I have a following dataframe: I would like to calculate pairwise hamming distance for each pair in a given year and save it into a new dataframe. Example: (Note: I made up the numbers for the hamming distance, and I don’t actually need to Pair column) I tried something like: Answer The function pairwise…