Monthly Archives: March 2019

Exploration into Python

The last couple of weeks have been centered around learning about how programming can be beneficial for historians when it comes to conducting research. Specifically, the programming language called Python shows promise when wanting to use it to conduct historical work. Python is considered as a high-level programming language. This means that it is easy for humans to understand it, while also being easy for a computer to understand. Python sticks out on its own being very easy for beginners to pick up and use because python is constructed to be more human readable. Being able to easily read and understand python, increases the likely hood people will use it as a tool. The desirable trait of being easily understood is what makes python such a strong language because anyone can pick it up and begin programming.

My personal experiences with Python programming stems back further than just these last two weeks. I initially worked at a summer camp in the summer of 2018 where I was tasked with creating python scripts. Coming from a dominate C++ and Java background it was a bit of challenge to write code in a less robotic language such as python. Where python really shines compared to other programming languages is its removal of data types. Variables in the majority computer programming language require a data type, a data type is a certain piece of information that can be stored in the computer. The information can range from sentences and words called strings, to integer and fractional numbers.  Without the requirement for data typed variables, it opens the doors to store any kind of data in a variable. The ability to store any kind of data in variables leads to unique solutions to problems. The majority of the programming historian lessons focuses on this unique approach to programming. like a lot of lessons explore the concept of data manipulation. Humans do this all the time when a person reads a book, they are processing the information from the book, then they manipulate it to form opinions. The process of reading texts can speed up, which is shown within programming historian lessons. specifically, the stylometry lesson, where 86 federalist papers are processed by the computer and compared for specific writing styles. Interacting with these lessons, I feel like the programming historian does an excellent job at explaining how to proceed in creating pieces of code that work efficiently to complete larger analysis jobs that would take historians a long time to complete.

 

DicOfAuthor = {} # a data structure which will contain the author, and a list of all the papers for this author.

listOfAuthors = [] # a list which will be gained from the view.


def __init__(self, Authors, dataDir):
listOfFiles = []

authorFoundInPaper = False

self.listOfAuthors = Authors

counter = 0

for file in os.listdir(dataDir):

if (file.endswith(".txt")):


listOfFiles.append(file)

singleFilePath = dataDir + '/'

while (counter < len(listOfFiles)):	# counts through all the authors in the given directory.

singleFilePath += listOfFiles[counter]

with open(singleFilePath) as singleF:	# opens a file and searches for the correct author in order to store it in the dictionary.

for words in singleF:

for author in self.listOfAuthors:


if(author in self.DicOfAuthor):

self.DicOfAuthor[author].append(listOfFiles[counter])

authorFoundInPaper = True


else:

self.DicOfAuthor[author] = [listOfFiles[counter]]
authorFoundInPaper = True

#self.DicOfAuthor[self.listOfAuthors[counter]] = counter # we have now created a key for the data, time to now add papers.
singleFilePath = dataDir + '/'
counter += 1

def returnKeySizeOfDictionary(self):

return len(self.DicOfAuthor)


def toString(self):

return print(self.DicOfAuthor)

if __name__ == '__main__':
# for testing of this class!

ListOfAuthors = ["Madison", "Hamilton", "Jay"]

dataDir = "C:/Schoolprojects/history396/history396GraphicalProject/Data/data"

test = authorConstruction(ListOfAuthors, dataDir)

print(test.returnKeySizeOfDictionary())

print(test.DicOfAuthor["Madison"], "\nnext author and their writings1:\n",

test.DicOfAuthor["Hamilton"], "\nnext author and their writings2:\n",

test.DicOfAuthor["Jay"], "\nnext author and their writings3:\n")

test.toString()

A Python script I wrote which would search through files and compare if an author would match the specific file.

Programming is a skill that historians should be perusing, especially in the next century. Social history is the process of acquiring the story of the everyday person. To bring their experiences to light to aid in painting a bigger picture of a certain time in history. In the early 1900s, this process could be accomplished by finding prime sources. However not everyone kept records, and if they were kept they had to withstand the test of time before historians could possibly find it and record it. With the turn of the century, records are now being kept digitally, they are stored on large databases in which can be accessed. It would take a single person hundreds of years to access and read through all the content that has been stored on the web. That’s why it is important for historians to learn how to program. The only way to process huge amounts of data would be to build a special kind of algorithm which allows large amounts of data to be processed. Once data is easily able to be searched through, the ability to paint more accurate historical information will be presented. On a much smaller scale, this type of activity is clearly demonstrated in a programming historian lesson. The lesson From Html to List of Words Part One. This lesson explores the concept of taking websites content and being able to extract the data from the website, then to further store that data into a list and explore the text that the website contains.  This type of searching and sorting allows historians to quickly search through Benjamin Bowsey 1780 criminal trial transcript, extracting the information from it. Being able to actively interact with a piece of code to extract information from a historical document highlights the power that Python has.

Another reason as to why historians should be learning how to program is because the only person who knows how to think historically is a person who is a historian.  The software is built by programmers, which in most cases, not a historian which built the tool. This means that the majority of tools developed does not have a historical use in mind. Instead, the tool was developed for another audience which was adapted and is used by a historian. If Historians began learning how to program the tools that were built by historians would be better adapted to target the purposes of historical research.

Exploration of Historical GIS

Historical GIS it the practice of combining History with Geography. When combining both studies, it allows researchers to explore the change in maps through a certain time period. Being able to explore the map as time progresses, opens the doors to new research questions. This is shown through Geoff Cunfers article Scaling the Dust Bowl. Where the author used GIS technology to challenge the original cause of the dust bowl. Originally the Dust Bowl was thought to be caused by farmers overusing the land, plowing up the native grasslands which kept the dirt intact.  However, after some research and the aid of Historical GIS software, Geoff Cunfers and his team discover a different narrative as to the cause of the Dust Bowl. Instead what was discovered was that throughout the period the regions which had the worst dust storms were places that suffered major draught. With the aid of new technology, it gives current historians better tools to explore historical questions on a much larger scale.

One feature which gives the Historical GIS some appeal is the ability to visually represent data. After following the lessons plan found on the website called Geospatial Historian the lesson teaches the readers how to represent data of the great plains in the 1930s. The data that is given is a map of the great plains within the United States of America. The interesting feature of this map is the ability to change different aspects of the map. Firstly, if the user wanted to display different layers on the map, they easily can by selecting it on the right side of the screen. On the great plains map, the user can toggle between turning on states, or counties, or if the user wanted to keep both on they could select both. The user can also color the map and arrange map layers to be able to easily determine the difference between counties and the states.

representation of counties or states.

The data given to the reader will be used later in the lesson. The data is extracted from a zip file, which can then be uploaded and selected through GIS software programs such as ArcMap, to visually represent the data. Being able to visually represent data in an easy to read graphical picture really helps aid and support research being done. In the software ArcMap, the data is uploaded through special files called gdb files. This file contains data that can be used within ArcMap. On the ArcMap user interface, the data is represented in a fashion which is similar to Microsoft Excel. This data can be selected and manipulated to show different values of data on the map. For example, if the user wanted to display the number of women between the ages of 18-25 all that would need to be done is selecting which fields in the gdb file that is wanted to be displayed on the overall map.

The One major flaw after using the software is the coloring of data and the presentation of colors. Different shades of red can be hard to distinguish between, and at times can feel like it makes the data that the researcher is trying to show harder to read. A good example of this is representing the number of Norwegians within the Great Plains in the 1930s in the United States of America. It would seem that the use of different colors would greatly help in improving the readability of the maps.

Norwegians located in great plains 1930’s

Esri is a company which specializes in GIS, specifically they created an advanced type of GIS software called ArcGIS Online. Some of the features that can be used with ArcGIS is creating a mapping which has a built-in function called smart mapping. Smart mapping suggests to the user interacting with the software the best colors and models to include into the map. This allows for an easier to read map compared to ArcMap.  Similar to ArcMap, ArcGIS allows users to upload custom data to the mapping service. Esri also contains other mapping software which could prove useful to historians. Historians provide a narrative as to why a certain event happened in history. They work closely with people and achieves to construct reasons as to why events happen. With the technology presented by Esri, story mapping allows historians to present maps in a storytelling method. Story map gives users the tools to incorporate research data and allows the user to construct methods to present the research in a much easier format to follow and understand. It is a form of public history, similar to that of a museum. In a museum, the data is presented through panels and is supported by the object that it is explaining. This allows for people interacting with the museum to gain a much deeper understanding of the object that is being presented. Story map allows the creator to input data and then support that data through images, maps, and other useful media to get their points across.

 

bibliography

  1.  Cunfer, Geoff. “Scaling the Dust Bowl” in Placing History: How Maps, Spatial Data, and GIS Are Changing Historical Scholarship. Anne Kelly Knowles, ed. (Redlands: ESRI Press, 2008), 95-121. http://esripress.esri.com/storage/esripress/images/133/knowles.pdf.
  2. Cunfer, Geoff. “ArcGIS Lesson 1: Mapping Great Plains Population.” Geospatial Historian: Open HGIS Lessons and Resources.Accessed March 9th 2019. https://geospatialhistorian.wordpress.com/lessons/arcgis-lesson-1-mapping-great-plains-population/.
  3. Esri. “Story Maps”. Accessed March 7th 2019. https://storymaps.arcgis.com/en/.