Skip to content

Instantly share code, notes, and snippets.

View ArthurEzenwanne's full-sized avatar
🏠
Working from home

Arthur Ezenwanne ArthurEzenwanne

🏠
Working from home
View GitHub Profile
# Get the names of columns with missing values
cols_with_missing = [col for col in X_train.columns if X_train[col].isnull().any()]
# Drop columns in training and validation data containing missing values
reduced_X_train = X_train.drop(cols_with_missing, axis=1)
reduced_X_valid = X_valid.drop(cols_with_missing, axis=1)
@ArthurEzenwanne
ArthurEzenwanne / WordAutomtionService.ps1
Created May 2, 2019 15:50
A gist to confirm that SharePoint Word Automation Service is working
# Path to original steps: https://absolute-sharepoint.com/2016/09/test-the-word-automation-service-application-with-powershell.html
# Confirm if this path is same on your env
Add-Type -Path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Office.Word.Server\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.Office.Word.Server.dll'
# Configure the job
$jobSettings = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJobSettings
$jobSettings.OutputFormat = "PDF"
# Configure your word automation service name and credentials
$job = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJob("Word Automation", $jobSettings)
@ArthurEzenwanne
ArthurEzenwanne / ConsoleApp_WordToPDF.cs
Last active March 20, 2019 10:50
A console app with input argument to convert word to pdf
using System;
using System.Diagnostics;
namespace ConsoleApp_WordToPDF
{
class Program
{
static void Main(string[] args)
{
// The code provided will print ‘Hello World’ to the console.
@ArthurEzenwanne
ArthurEzenwanne / WordPDFConvert.cs
Last active July 7, 2023 06:21
C# code to convert .docx to .pdf using Microsoft.Office.Interop.Word
using System;
using Microsoft.Office.Interop.Word;
using Word = Microsoft.Office.Interop.Word;
namespace WordToPDFConsoleApp
{
class Program
{
static void Main(string[] args)
{
@ArthurEzenwanne
ArthurEzenwanne / WordToPDFProgram.cs
Created March 4, 2019 15:48
C# .docx to .pdf convesion
using System;
using System.IO;
//wordtopdf.dll downloaded from https://www.c-sharpcorner.com/uploadfile/698727/convert-word-file-to-pdf-using-c-sharp/
using WordToPDF;
namespace WordPDFConsoleApp
{
class Program
{