Summary of Reading – Dec'19/Jan '20

A Century is Not Enough (Sourav Ganguly) – Focused primarily on Ganguly’s fighting spirit during his toughest times, and how he got himself to bounce back no matter how low the odds seemed to be. While we do get an interesting snapshot of his cricketing journey, it definitely would’ve been much more exciting had he spent more words on the IPL, or about his life before representing India. What the book conveys, in my opinion, is don’t give up no matter how much you’ve already done, don’t take your position for granted. On a general basis, not that good a book because it focuses solely on the mental aspects of Ganguly’s game, and has sparsely located personal anecdotes and experiences.

Prelude to Foundation (Isaac Asimov) – A step as compared to Foundation’s Edge and Foundation and Earth. What I took away from the initial stages of the book was the contrast between what psychohistory is in the main trilogy, and how unsure Seldon is of it in the book. Really just showed no matter how improbably or irrelevant something seems at the start, its potential really can’t be measured. The different cultures/societies introduced was also fascinating, especially Dahl. What made Dahl stand out, for me, was just how close equality seemed to be, but the irony involved with Dahlites both wanting equality with other sectors across Trantor, and having factions/ranks within their own societal order (no heatsinkers in the house etc.). The ending was also pretty awesome, especially with Hummin being revealed as Demerzel, but then being revealed as Daneel (robot) who was implementing the zeroth law of robotics the entire time. That part where Daneel reveals who also has another plan he doesn’t want Seldon to know about is also pretty telling, with him obviously referring to Gaia. Really served as the sort of reference that made everything much more connected to the later books (chronological).

The Culture Code (Daniel Coyle) – Not that bad, but not excessively good either. The monotone style of writing made reading the book a tad hard (although a short length rescued it). It was interesting reading about how having techniques that promoted open-mindedness in the form of having the ability to question anything, even the management, was pretty interesting. Some parts were inspirational, not that good a read but still worthy trying, especially if you’re taking a shot at being an effective leader.

Forward the Foundation (Isaac Asimov) – Nearly not as good as Prelude to Foundation. I hated how lonely Seldon became at the end. Plus, I’m not a huge fan of Dors being a robot from the very start. How Seldon’s love “made her human” was pretty emotional, but that reveal was way too forged. Also didn’t like Raych and family moving away, and then Seldon sending Wanda away for her own good. Huge difference between the Seldon here, and the Seldon portrayed in the original Foundation book. Also wanted a closer look at Gaal Dormick. I think the Foundation Saga would’ve been decisively better without the two prequel books, they seem like dead weight to me.

Taking a Look at the Entire Foundation Saga

I finished reading Asimov’s Foundation Saga yesterday, and truth is, it has blown my mind. The sheer number of characters, worlds, plot-lines, and events dotted throughout the entire saga is insane. Science fiction doesn’t get any better than this.

Having a story that spans over half a millennium inadvertently led to tons of characters being introduced and cast away. I think what really stood out for me here is that the individual really is powerless, and effectively irrelevant in the larger scheme of things. What one person does can’t ever impact what larger social and economic forces will eventually do. The best example here is the collapse of the empire’s effort to encircle and besiege the Foundation, regardless of the main characters of the time who tried to play their parts as heroes but later realized they have no position within Seldon’s timeline.

I really wanted Asimov to dive deeper into how psychohistory works. We really don’t know anything, apart from the fact that the prime radiant is the single most important tool available to the Second Foundation, and that it’s a predictive science. The only semblance of ‘work’ we have is people like Yugo Amaryl and Seldon staying locked in their offices almost the entire time (with the story detailing what happens when they’re not working). Another thing that I really didn’t get was the contrast between the Trantor we see at the start of the first Foundation book, and the Trantor we see at the end of the second prequel series book. Foundation started off with depicting Trantor as this colossal metallic world, technologically advanced and densely populated with vibrant civilians. However, the Trantor we see at the end of Forward the Foundation is a bleak, dull world with no semblance of life. A world stumbling in its own steps. In fact, the entire premise of the first book was that the glory of Trantor would be tarnished with time and large forces, but the second prequel presents an already worn out Trantor. Lastly, I really don’t see how the empire’s “slow” disintegration into barbarism takes place over a single lifetime. While the Foundation grows strong over hundreds of years, the entire galactic empire splits apart within a maximum of fifty years. Weird.

However, the entire saga clearly had its highs. I absolutely loved Foundation and Empire and Second Foundation. Here are some of my favorite moments from the entire saga:

  1. Bayta Darell shoots Ebling Mis/Reveals the Mule’s identity – Maybe the most well-executed twist I’ve ever seen in writing. Executed to perfection, such that every single event that occurred before seemed to fall into place and conform to this obvious pattern everyone missed. What struck me even more was the Mule leaving Bayta free of being manipulated by his psychic powers simply because she was the first person in his life who genuinely showed caring for him. Powerful. I think what Asimov meant to convey here was that emotions can play a huge role too in any story. Succeeded to some extent.
  2. The Mule finally conquers Terminus – I really adore the twist that comes with Seldon’s recording being not even remotely close to what’s actually happening. It’s utterly shocking, and after two books which kept Seldon and his psychohistory as the bedrock of the entire story, pretty impactful too. Really just conveys the gravity of the situation, and how big a threat the Mule is.
  3. Seldon’s hearing – Seldon vs Trantor, or rather the Empire is entertaining. It’s a classic play on those science versus politics debates we still have today. Seldon’s assertion of how “Scientific Truth is beyond loyalty or disloyalty” is also pretty chilling.
  4. The Mule’s showdown with the Second Foundation – I enjoyed this entire scene just for the thrill it provided. Psychic powers versus psychic powers was pretty eventful. Really caught my attention. Every person trying to double cross the other and control the situation as per his plan, and every single move turning out to be part in a different person’s setup, so much so that even the reader didn’t know who was who until the Mule was defeated. However, I was a bit shocked by how the Second Foundation sacrificed the people of an entire planet just to defeat the Mule.
  5. The Second Foundation’s location is revealed – I think this is the zenith of the entire saga. Everything really just falls down from here. At this point, everyone is wondering whether the Second Foundation is located at Terminus, Trantor, or another obscure world in an infinitesimally large galaxy. I sort of spoiled it for myself by flipping through the first book, and realizing how Seldon told Gaal Dornick that some would stay behind for another purpose. The part of this entire reveal that really struck me wasn’t the reveal itself, but how Trantor is the place where the “Stars end,” which is quite poetic and somewhat stunning. Brought out some nostalgia as well.
  6. Salvor Hardin subdues Anacreon – Liked this thing simply because of the way Hardin brought an entire empire to its knees using the wonder of science, or rather the dependency of an entire empire on it. A bit like Rick bringing down the value of the galactic currency to null.
  7. Foundation’s Ending – The dialogue about the sun and spear was brilliant. Really put the notion of this ant that the Foundation was at the point facing the mammoth that was the empire, set the tone perfectly for the second book in the series (admittedly this drops off a bit at the start of the second book). I view this entire thing as a giant octopus unfurling its tentacles.

What I loved about the saga was the fact that it explored nearly every facet of human existence, and the sheer quality of science fiction it had. Countless characters; degrading and improving technology; falling and rising galactic empires.

Summary of Reading (November ’19)

Foundation; Isaac Asimov – Perhaps the only sci-fi book I’ve read that is able to depict a stunning future along with capturing human flaws and characteristics so accurately. While there was always the sense that the story was pretty much done and dusted right at the start due to the Seldon Plan, what made this book interesting is the portrayal of just how insignificant most individuals are in the grand scheme of things, yet still have potential to influence larger economic and social forces. The plot takes off with the decay of a galactic empire, a theme that definitely hits home in the modern age. My favorite moment of the book is Seldon’s hearing due to his dire predictions for the empire. It shows how scientific truth and empirical evidence often clash with political opinions and desires, and how the former is ignored amidst bureaucracy. Seldon’s statement of “Scientific truth being beyond loyalty or disloyalty” really did give me goosebumps. I see such reflections throughout the world. Certain leaders ignoring climate change. The flat earth theory (utter bs). Even religion, to a certain extent.

Foundation and Empire; Isaac Asimov – The first half of the book conveys an incredibly interesting message, the threat of mutiny. If a ruler has weak military commanders, his empire won’t grow. However, if a ruler has strong military commanders, the threat of rebellion persuades the ruler to remove those commanders. However, the story really did begin with the arrival of the Mule. Thereafter, it’s impossible to put the book down. Everything really just builds up to the end, wherein we learn that the mysterious Mule has been hiding in plain sights all along. Claimed to be a fear-arousing, dark giant with telekinetic powers, he turns out to be pale, frail clown with psychic abilities and powers of emotional manipulation. For me, it really just goes to show how huge an impact emotions have on us human beings. The Mule was able to forge a kingdom, and almost an empire had it not been for the Second Foundation and Bayta Darell exclusively due to his vast emotional powers that allowed him to make entire populations feel miserable.

Second Foundation; Isaac Asimov – The high point in the Foundation series. What makes this book so riveting is the sheer number of possibilities behind and beyond each and every event. Every occurrence has multiple explanations. Every plan years of planning and perseverance. This book really is about intellectual and mental, or psychic battles, rather than the physical challenges faced earlier. Every character strives to outsmart and improvise. Furthermore, Asimov incorporates various other elements that make everything seem all the more human. For instance, the sacrifice of an entire planet to fool the Mule into thinking he had destroyed the Second Foundation, or maybe sacrificing the life, or rather mind, of a Second Foundationer to trick the Mule into falling into the big trap.

Foundation’s Edge; Isaac Asimov The series really does take a drop from here. The characters are much more boring, and the story-line feels like something done just for the sake of writing a book. Regardless, I did find some aspects interesting, such as the gravitics-based spaceship, and the ‘brain’ of the same. This also loses that ‘foundation’ feel with the entire story revolving around a handful of characters, unlike the other books wherein characters come and go but large economic and social forces remain constant.

Foundation and Earth; Isaac Asimov – I don’t know whether this book is horrible because it just is or because it continues this new character-based storytelling format. The first three books covered upto 150 years each, yet the 4th and 5th ones manage to not even span a decade, and act more like documentaries of Trevize’s journey. The entire purpose of this book is to answer a question raised at the end of the last book, which makes no sense. What is even more damaging is the fact that there is absolutely no focus on both the Foundations, which is supposed to be the purpose behind the entire saga.

r/dailyprogrammer – Yahtzee Upper Section Scoring

Here’s the source.

Description

The game of Yahtzee is played by rolling five 6-sided dice, and scoring the results in a number of ways. You are given a Yahtzee dice roll, represented as a sorted list of 5 integers, each of which is between 1 and 6 inclusive. Your task is to find the maximum possible score for this roll in the upper section of the Yahtzee score card. Here’s what that means.

For the purpose of this challenge, the upper section of Yahtzee gives you six possible ways to score a roll. 1 times the number of 1’s in the roll, 2 times the number of 2’s, 3 times the number of 3’s, and so on up to 6 times the number of 6’s. For instance, consider the roll [2, 3, 5, 5, 6]. If you scored this as 1’s, the score would be 0, since there are no 1’s in the roll. If you scored it as 2’s, the score would be 2, since there’s one 2 in the roll. Scoring the roll in each of the six ways gives you the six possible scores:

0 2 3 0 10 6

The maximum here is 10 (2×5), so your result should be 10.Examples

yahtzee_upper([2, 3, 5, 5, 6]) => 10
yahtzee_upper([1, 1, 1, 1, 3]) => 4
yahtzee_upper([1, 1, 1, 3, 3]) => 6
yahtzee_upper([1, 2, 3, 4, 5]) => 5
yahtzee_upper([6, 6, 6, 6, 6]) => 30

Opional Bonus

Efficiently handle inputs that are unsorted and much larger, both in the number of dice and in the number of sides per die. (For the purpose of this bonus challenge, you want the maximum value of some number k, times the number of times k appears in the input.)

yahtzee_upper(
    [1654, 1654, 50995, 30864, 1654, 50995, 22747, 1654, 1654, 1654, 1654, 1654, 30864, 4868, 1654, 4868, 1654, 30864, 4868, 30864]
) => 123456

Solution

Answering this problem is pretty trivial. All you need to do is a create another list that contains all numbers from 1 through the maximum number in the inputted list. Then multiply each number in the new list by the number of time it appears in the old list using the count function native to python. Here’s how it goes:

def yaht(t):
    return max([t.count(j) * j  for j in [i for i in range(max(t)+1)]])
    
# that's all there is to it!

The Foundation Series

This post is sponsored by sheer excitement. May contain spoilers.

It would be accurate to say that the defining aspect of this brilliant series is how ‘human’ everybody is. Human flaws, intellect, and experiences form every single plotline. Whether be it underestimation sanctioning the Mule’s rise to power, or the outrage at Seldon’s predictions of the collapse of the far-reaching Galactic Empire. Every single facet of this book is page-turning. It has everything, from planets coated in metal to spaceships that sync with the mind. The Foundation Series is a must-read for anyone out there.

What I also love is how absorbing the story is even though it spans a thousand years. Attachments to characters are disbanded. The only thing that does remain constant is the inevitability of psychohistory. This allows Asimov to toy around with dozens of characters, making the book pretty unique. Here are some characters I can recall off the top of my head:

  • Hari Seldon (psychohistorian)
  • Hober Mallow (Trader and later Mayor)
  • Salvor Hardin (First Mayor of the Foundation)
  • The Mule (Mutant with powers of emotional manipulation)
  • Bayta Darell (Civilian who stopped the Mule)
  • Arkady Darell (Played like a doll by the Second Foundation)
  • Golan Trevise (Big decision-maker)
  • Munn Li Compor (Councilman)
  • Bail Channis (unconverted military general)
  • Hann Pritcher (converted military general)
  • Bel Riose (ambitious military general)
  • Janov Pelorat (Historian trying to find Earth)
  • Preem Palmer (First Speaker)
  • Stor Gendibal (Speaker)
  • Ebling Mis (Psychologist)

The number of locations involved is fascinating as well. From planets near the galactic centre to those in the outer rim. From worlds abounding with radioactivity to kingdoms at Star’s End. From isolated global consciousness established by rogue robots to pleasure worlds like Kaglan.

Every action has a consequence. Everything plays a part in the larger scheme. Economic and social forces dictate everything. However, in an interesting twist, the only thing that threatens fate is individual actions. The ability to think, see the truth as it is, not as it should be, hampers the Seldon plan. For me, this is inspiring. After all, it does support the view that even one person can turn the world on its head. The Foundation series makes me appreciate certain qualities I never acknowledged before. It makes me desire the iron will of Salvor Hardin. It makes me search for the mental powers of the Second Foundation within myself. It makes me quest for the genius of Hari Seldon..

It would be foolish to express my awe in a single blog post. Pay up. Read this masterpiece of a series. It will open you to aspects of human nature that pass unnoticed. It advertises fallacies and advocates for morality yet sureness.

Here are some amazing quotes from the series.

“Violence is the last refuge of the incompetent.”

Hari Seldon

“Never let your sense of morals prevent you from doing what is right.”

Salvor Hardin

This one’s pretty chilling. Pretty applicable to the real world as well.

“Scientific truth is beyond loyalty and disloyalty”

Hari Seldon

“It’s always easy to explain the unknown by postulating a superhuman and arbitrary will”

Homir Munn

So true.

“The advance of civilization is an exercise in nothing but the limiting of privacy”

Janov Pelorat

September ’19 – Summary of Reading

Pebble in the Sky; Isaac Asimov – Went from a mundane storyline at the start to a brilliant ending bursting with energy. I found it really hard to read this book at the start, primarily due to the massive amount of time and content Asimov spent on setting up stuff. However, as soon as Schwartz escaped, the book magnificently picked up the pace and had me invorigated right till the end. I think it was interesting to see non-Earth people treating Earth people the same way some humans treat other humans, an eye-opener for me.

I, Robot; Isaac Asimov – A storyline composed out of distinct short stories didn’t look impressive to me before I started reading the book, but I was drastically wrong. I think the definitive quality of this book is the way it represents the future. Furthermore, the sheer amount of advancement that is palpable throughout the book excited me a lot. What I absolutely loved was how human elements were combined with robotics, leading to stuff like robopsychology, cyber-sentience, and paradoxes in reality. The last chapter was a bit boring, but on an overall basis, definitely one of the better books I’ve read.

The Godfather; Mario PuzioA well-written book, full of suspense and dynamics, and successful at creating a constant sense of danger. I enjoyed how Puzio switched from character to character and exploited every possible plotline – inevitably creating contrasts and ironies. Every single action had a consequence. That being said, there were some aspects I didn’t like that much. Luca Brasi’s death really hit me hard, and it seemed pretty avoidable and impossible as well. On an overall basis, one of the better books I’ve read, certainly not the best, but a memorable read nonetheless. Puzio’s repeated emphasis on the allure of maintaining composure and calm, and the foolishness of succumbing to anger and paranoia was one of the more concrete messages that got to me.

Automate The Boring Stuff; Al Sweigart – Nice, enthralling introduction to how the powerful the python language can be when used properly. I especially enjoyed the chapters on working with APIs and web browsers. That being said, as a consequence of the book having already become really old, there are various outdated practices that could prove to be misleading. I also don’t get why there’s so much on manipulating data when the far better alternative of pandas already exists.

The Stars, Like Dust; Isaac Asimov Just amazing. This book incorporated everything from rebellion planets to emotional manipulation, had treachery and plots running beneath pre-existing sub-plots. Every page offered a monumental event, every chapter a higher mountain to climb. The end did seem a bit cringy to me, with a breadcrumb being offered for US politics, but it was nonetheless inspiring. The characters were intricately crafted, and the entire affair of good guys being bad guys and bad guys being good guys had the effect of keeping one on the edge of his/her seat. Perhaps the most brilliant aspect of the book, the thought, and later truth, of the rebellion planet not being in a mysterious nebula but instead in plain sight, and the true nature of the director being hidden away in plain sight as well managed to enthrall me.

Locking and Unlocking .pdf files

Here, I’ll be showing you how to set the same password for all .pdf files in a directory simultaneously using python, instead of manually setting passwords for each pdf. This comes in handy for files with over hundreds of .pdf documents. The full code for setting passwords can be found here, and the same for unlocking files is available here.

We will be using the PyPDF2 and os modules. To start off, we’ll get the user to input their password and root directory. Then, we’ll use the os.walk()function to iterate over each file in that directory and its sub-directories.

for (root, dirs, files) in os.walk(path):
	for filename in files:
		if filename.endswith('.pdf'):
		    pdfFile = open(root + '/' + filename, 'rb')
			pdfReader = pypdf2.PdfFileReader(pdfFile)

Above, we store the result of each ‘walk’ as a three-element tuple. We then access each file in the current directory, and use an if statement to check whether or not the file concerned has a .pdf extension. Then, we open the file in a read binary format, and also initialise a pdfFileReader object for the file.

Now, to make an encrypted pdf using PyPDF2, we’ll read one file and copy over its contents into another file, then encrypt the second file and delete the first. Do note that opening the first file in a write binary format won’t delete it, it’ll delete the data inside the file, but not the actual file. To delete files, we can use the os.remove() function.

# inside 'endswith('.pdf')' if

if pdfReader.isEncrypted == False:
    pdfWriter = pypdf2.PdfFileWriter()
    for pageNum in range(pdfReader.numPages):
		pdfWriter.addPage(pdfReader.getPage(pageNum))

	pdfWriter.encrypt(password)

	if filename.endswith('decrypted.pdf'):
		resultPdf = open(root + '/' + filename[:-13] + 'encrypted.pdf', 'wb')
	else:
		resultPdf = open(root + '/' + filename[:-4] + 'encrypted.pdf', 'wb')

	pdfWriter.write(resultPdf)
	os.remove(root + '/' + filename)
	resultPdf.close()
	pdfFile.close()
	

Now, we firstly check whether the file in question is encrypted or not. If not, we initialise a PdfFileWriter object, and copy over the contents of the file to the object. Using the user-inputted password, we encrypt the new file and then save it with a suffix of ‘_encrypted.pdf.’ Then, the os.remove function is used to delete the starting file.

Unlocking files has the same methodology. Using a python program also saves a lot of time when say unlocking hundreds of files. Once again, we use os.walk() to traverse our root directory. Here, we also check for whether the file is encrypted, and proceed only if it is.

if pdfReader.decrypt(password) == 1:
    pdfWriter = pypdf2.PdfFileWriter()
    for pageNum in range(pdfReader.numPages):
        pdfWriter.addPage(pdfReader.getPage(pageNum))
	
	if filename.endswith('encrypted.pdf'):
	    resultPdf = open(root + '/' + filename[:-13] + 'decrypted.pdf', 'wb')
	else:
	    resultPdf = open(root + '/' + filename[:-4] + 'decrypted.pdf', 'wb')
	pdfWriter.write(resultPdf)
	os.remove(root + '/' + filename)
	resultPdf.close()
	pdfFile.close()
else:
    print('password incorrect for {}'.format(root + '/' + filename))
    

If the inputted password works for a file, the file is unlocked, then its contents are copied over into a new file with no password. Then, the encrypted file is deleted, and the new file replaces it. If the inputted password is incorrect, the program outputs the name of the file.

Application-wise, these programs are very efficient. For example, if there is a website with hundreds of free resources (many of which are password protected PDFs), you can download all these files and use the program above to unlock all files simultaneously. Using a brute-force attack (coming soon), we can also download hundreds of files and try to hack them using a spin-off of the program above.

Using Python to make Multiplication Tables in Excel

A really easy problem. Here’s the full code.

Now, we need to create an n by n multiplication table in excel using a python program, where n is an arbitrary, positive integer. We will do this using the openpyxl module. Firstly, we’ll initialise our notebook and set our current sheet to Sheet, which is the default active sheet.

wb = openpyxl.Workbook()
sheet = wb['Sheet'] # or wb.active
n = int(input('enter n| '))

For the purposes, a ‘bold’ font style object has also been created. I will assign this to the row and column headings later.

for i in range(2, 2+n):
	sheet['A' + str(i)].value = i-1
	sheet['A' + str(i)].font = boldFont
	sheet[get_column_letter(i) + '1'].value = i-1
	sheet[get_column_letter(i) + '1'].font = boldFont

Above, all I’ve done is create row and column headings for all integers upto and including n, with each heading being written in bold characters. Now, time to create the table.

for i in range(2, sheet.max_row + 1):
	for j in range(2, sheet.max_column+1):
		sheet[get_column_letter(j) + str(i)].value = sheet[get_column_letter(j) \ 
		        + '1'].value * sheet['A' + str(i)].value

Making the table is really simple. What I’ve done is iterate over each row heading, and then over each column heading inside the row, then find the product of these two and assign it to the required cell. You could also do this using excel formulas, but I think this solution is reasonably efficient.

Here’s another solution that I found on github.

for rowNum in range(1, number+2):
	for colNum in range(1, number+2):
		if rowNum==1 and colNum==1:
			sheet.cell(row=rowNum, column=colNum).value=''
		elif rowNum==1:
			sheet.cell(row=rowNum, column=colNum).value = colNum-1
			sheet.cell(row=rowNum, column=colNum).font = boldFont
		elif colNum==1:
			sheet.cell(row=rowNum, column=colNum).value=rowNum-1
			sheet.cell(row=rowNum, column=colNum).font = boldFont
		else:
			sheet.cell(row=rowNum, column=colNum).value = (rowNum-1)*(colNum-1)

It is shorter, but I don’t think it’s that elegant due to the usage of if/else statements. But that’s just personal bias. Instead of iterating over headings and content cells differently, the author here iterates every single cell (including 0,0) in one for loop.

Here’s a sample multiplication table for n = 18:

Arduino Crystal Ball

This is the 11th project in the Arduino Starter Kit. Do note that I have skipped the 9th and 10th projects because my DC motor isn’t working.

Setup

Here’s what we need:

  • Arduino UNO + Breadboard
  • Jumper wires
  • LCD Screen
  • Potentiometer
  • Tilt Sensor
  • 1 x 10 kΩ Resistor
  • 1 x 220 Ω Resistor

Layout

Here’s our schematic, as per the Arduino Projects Book.

And here’s my incredibly messy build:

Code

We will be using the LCD Display (Arduino) library to control our screen. While setting up, all we need to do is print out the initial message we want the user to see.

void setup() {
 lcd.begin(16, 2);
 pinMode(switchPin, INPUT);
 lcd.print("Crystal Ball");
 lcd.setCursor(0, 1);
 lcd.print("At your service");
}

Then, using the random() method, we will give our output.

reply = random(8);
switch(reply) {
    case 0:
    lcd.print("Yes");
    break;
    case 1:
    lcd.print("Probabale");
    break;
    case 2:
    // ...

That’s all there is to it. You can see the full code here.

Metrics for Analyzing Urban Societies

If we want to analyze specific regions or communities within cities, there must be some indicators that act as differentiators. For example, carbon dioxide concentrations, literacy rates, water hardness levels, diabetes levels etc. We can use multiple quantitative metrics. However, the hard part is finding relationships between these metrics and interpreting them.

With regards to Jaipur, there are various ways to collect data and use metrics. The first, simpler method is to set up your own grid of sensors around the city, each sending data in files based on its latitude and longitude rather than identification number. The second would be to get in touch with say the state government, or a sufficiently large private company.

Now, along with collecting numerical data, we will also need some qualitative data (and assign classes) to establish patterns. For example, if a specific region with a certain pincode has an abnormal concentration of carbon dioxide and a high usage of cigarettes, we would expect severe health, or even comfort problems there.

Getting the data is the hard part. Kaggle has a database on Jaipur, but only regarding weather data, which sucks. There are various other governmental sources, but most are written in hindi and are consequently very hard to input into a model as a language to language model/framework will be required. If all the sheets have a standard template, we could type in the data manually for the first few sheets, and then figure out a scraper to do the job for us.