The entire script looks for mathematical relationships between CO2 concentration changes and pitch changes from a pipe organ. This script uploads, cleans data and organizes new dataframes, creates figures, and performs statistical tests on the relationships between variable CO2 and frequency of sound from a note played on a pipe organ.
This uploader script:
1) Uploads organ note pitch data files
2) Munges it (creates a Date Time column for the time stamps), establishes column contents as floats
Here I pursue data analysis route 1 (as mentionted in my notebook.md file), which involves comparing one pitch dataframe with one dataframe of environmental characteristics taken at one sensor location. Both dataframes are compared by the time of data recorded.
In [1]:
# I import useful libraries (with functions) so I can visualize my data
# I use Pandas because this dataset has word/string column titles and I like the readability features of commands and finish visual products that Pandas offers
import pandas as pd
import matplotlib.pyplot as plt
import re
import numpy as np
%matplotlib inline
#I want to be able to easily scroll through this notebook so I limit the length of the appearance of my dataframes
from pandas import set_option
set_option('display.max_rows', 10)
First I upload my data sets. I am working with two: one for pitch measurements and another for environmental characteristics (CO2, temperature (deg C), and relative humidity (RH) (%) measurements). My data comes from environmental sensing logger devices in the "Choir Division" section of the organ consul.
In [11]:
#I import a pitch data file
#comment by nick changed the path you upload that data from making in compatible with clone copies of your project
pitch=pd.read_table('../Data/pitches.csv', sep=',')
#assigning columns names
pitch.columns=[['date_time','section','note','freq1','freq2','freq3', 'freq4', 'freq5', 'freq6', 'freq7', 'freq8', 'freq9']]
#I display my dataframe
pitch
Out[11]:
In [13]:
#Tell python that my date_time column has a "datetime" values, so it won't read as a string or object
pitch['date_time']= pd.to_datetime(env_choir_div['Date_time'])
#print the new table and the type of data to check that all columns are in line with the column names
print(pitch)
#Check the type of data in each column. This shows there are integers and floats, and datetime. This is good for analysing.
pitch.dtypes
Out[13]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: