Skip to main content

Posts

Showing posts with the label code

Micropython example

micropython code on github   This is the micropython code I used on my raspberry pico to collect sensor data and send it to my own home IOT mqtt broker.   I specialise in making code that can collect data and send it and perpetually continue to do that without getting an error disrupting the program.

Date-Time Fixer with Python

Sample of my Python Code https://github.com/cuthbert86/RiverProject/blob/main/datetime1.py This is an example of some of my data management work.  I wrote a python code that combined date and time columns into a single date-time column and then formatted it into .ISO format. import pandas as pd # Load your data from a CSV file (adjust the filename and path accordingly) file_path = 'riverdatacsv.csv' df = pd.read_csv(file_path) # Merge Date and Time columns into a single DateTime column with the ISO 8601 format df['DateTime'] = pd.to_datetime(df['Date'] + ' ' + df['Time']).dt.strftime('%Y-%m-%dT%H:%M:%S') # Drop the original Date and Time columns if needed df = df.drop(['Date', 'Time'], axis=1) # Display the DataFrame with the new DateTime column print(df)