Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import pandas as pd
import numpy as np
os.chdir("C:/Users/ale_v/Documents/Polimi/git_fork_clone2/AnotherClone/Scientific_Python_Assignments_POLIMI_EETBS/Assignment 7 Pandas B DeadLine Nov 8th 2017/__Guidelines__")
latitude_loc=45
beamIrr_DF = pd.read_csv("beamIrradiance.csv" , sep=";", index_col=0)
diffuseIrr_DF = pd.read_csv("diffuseIrradiance.csv" , sep=";", index_col=0)
beamIrr_DF["45"]["E"]
diffuseIrr_DF["45"]["E"]
PXI_45_E = beamIrr_DF["45"]["E"]+diffuseIrr_DF["45"]["E"]
windows_DF = pd.read_csv("windows.csv", sep=";", index_col=0)
windows_DF["PXI"] = np.array([PXI_45_E,0,0,0])
windows_DF.to_csv("windows_completed_withPXI.csv" , sep=";")
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Name;Direction;width;Height;Area;Window_ID;Frame_type;Frame_material;U;SHGC;HF;Q heating;SLF;Doh;Xoh;Fshd;IntShading_ID;IntShading_closeness;IAC_cl;IAC;Tx;Ed;ED;PXI;FFs;C_value;CF;Qcooling
<<<<<<< HEAD
east;E;8;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;747;0;0;0;0
west;W;8;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;0;0;0;0;0
south-Fixed;S;2;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;0;0;0;0;0
south-Operable;S;2;1.8;0;5c;Operable;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;0.64;0;0;0;0;0;0;0
=======
east;E;8;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;748.0;0;0;0;0
west;W;8;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;0.0;0;0;0;0
south-Fixed;S;2;1.8;0;5c;Fixed;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;1.0;0;0;0.0;0;0;0;0
south-Operable;S;2;1.8;0;5c;Operable;Wood;0;0;0;0;0;0.9;0.3;0;DrapesLightOpen;0.4;0;0;0.64;0;0;0.0;0;0;0;0
>>>>>>> e6c3439b3e8e67251c7895875b304c4f164ff375
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os
import numpy as np
import pandas as pd

import scipy as sp

os.chdir("C:/Users/ale_v/Documents/Polimi/Behzad/MyNewPandas")

def PXI_window(direction,latitude):
DF_beamIrr=pd.read_csv("BeamIrradiance.csv",sep=";",index_col=0)
DF_diffIrr=pd.read_csv("DiffuseIrradiance.csv",sep=";",index_col=0)
name_of_columns_D=DF_beamIrr.columns.get_values()
name_of_columns_as_numbers_D = name_of_columns_D.astype(np.int32, copy=False)
ED=sp.interp(latitude,name_of_columns_as_numbers_D,DF_beamIrr.loc[direction])
name_of_columns_d=DF_diffIrr.columns.get_values()
name_of_columns_as_numbers_d = name_of_columns_d.astype(np.int32, copy=False)
Ed=sp.interp(latitude,name_of_columns_as_numbers_d,DF_diffIrr.loc[direction])
PXI_value=ED+Ed
return PXI_value
myResult=PXI_window("S",42) #example

windows_DataFrame = pd.read_csv("windows.csv", sep=";",index_col=0)

windows_DataFrame.index.tolist()


exI_PXI_values=[]
latitude=45
for index in windows_DataFrame.index.tolist():
print index
print "PXI value for this direction is: "+str(PXI_window(windows_DataFrame["Direction"][index],latitude))
exI_PXI_values = np.append(exI_PXI_values,PXI_window(windows_DataFrame["Direction"][index],latitude))
print "The PXI values updated list is: "+str(exI_PXI_values)
windows_DataFrame["PXI"] = exI_PXI_values

windows_DataFrame.to_csv("windows_completed_withPXI.csv" , sep=";")



Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pandas as pd
import matplotlib.pyplot as plt
plt.close("all")


HeatingOpaqueLoadValues = [1149.2,1240,92.5]
CoolingOpaqueLoadValues = [547.5,541.6,43]
labels=['wall','roof','door']
plt.pie(HeatingOpaqueLoadValues,labels=labels,startangle=90,explode=(0.1,0,0), autopct='%1.1f%%')
plt.figure(2)
plt.pie(CoolingOpaqueLoadValues,labels=labels,startangle=90,explode=(0.1,0,0), autopct='%1.1f%%')

import numpy as np
UH_series=np.arange(0.0, 1.0, 0.05)
UH=pd.Series(UH_series)

def function(x):
y=(1149.2*x*0.438+1240+92.5)
return y

y_series=UH.apply(function) #in this way u can do functions without vectorize ur array
plt.figure(3)
plt.plot(UH,y_series)
plt.show()
plt.xlabel("U value")
plt.ylabel("Wall heating value")
plt.title("Heating value wrt U value")
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import pandas as pd
import matplotlib.pyplot as plt

x=range(-10,11)
x_series = pd.Series(x)

def ourFunction(x):
y=x**2-5
return y

y_series = x_series.apply(ourFunction)


x1=[1,3,5,8]
y1=[12,18,28,39]

plt.plot(x1,y1)
plt.show()
plt.xlabel(" This is the name of my x axis")
plt.ylabel(" This is the name of my y axis")
plt.title(" This is just a random useless plot!")

x2=[2,4,7,8]
y2=[10,21,25,42]
plt.plot(x2,y2, hold=False)

plt.close("all")
plt.plot(x_series,y_series)

fig1 = plt.figure()
plt.close(fig1)
plt.figure(1)

plt.figure()
# How to plot scatter plots !!
x4=[3,4,5,8,12]
y4=[45,58,87,95,115]
x5=[4,5,9,10,11]
y5=[23,29,65,82,80]
plt.scatter(x4,y4,label="The first one",color="b",marker="*",s=50)
plt.scatter(x5,y5,label="The second one",color="r",marker="o",s=50)
plt.legend()
plt.close("all")

items = [1,2,3]
labels = ["wall","roof","door"]
HeatingLoadValues = [2500,1800,150]
cols=["r","b","g"]

plt.bar(items,HeatingLoadValues,color="g")
plt.xticks(items,labels,color="r")

# How to plot a pie chart !
plt.close("all")
plt.figure()
plt.pie(HeatingLoadValues,labels=labels,colors=cols,startangle=90,explode=(0.1,0,0), autopct='%1.1f%%'))



Binary file not shown.