Python and Hindi

So I’ve recently discovered that using Python to analyse data is, to me, like talking in Hindi. Let me explain.

Back in 2008-9 I lived in Delhi, where the only language spoken was Hindi. Now, while I’ve learnt Hindi formally in school (I got 90 out of 100 in my 10th boards!), and watched plenty of Hindi movies, I’ve never been particularly fluent in the language.

The basic problem is that I don’t know the language well enough to think in it. So when I’m talking Hindi, I usually think in Kannada and then translate my thoughts. This means my speech is slow – even Atal Behari Vajpayee can speak Hindi faster than me.

More importantly, thinking in Kannada and translating means that I can get several idioms wrong (can’t think of particular examples now). And I end up using the language in ways that native speakers don’t (again can’t think of examples here).

I recently realised it’s the same with programming languages. For some 7 years now I’ve mostly used R for data analysis, and have grown super comfortable with it. However, at work nowadays I’m required to use Python for my analysis, to ensure consistency with the rest of the firm.

While I’ve grown reasonably comfortable with using Python over the last few months, I realise that I have the same Hindi problem. I simply can’t think in Python. Any analysis I need to do, I think about it in R terms, and then mentally translate the code before performing it in Python.

This results in several inefficiencies. Firstly, the two languages are constructed differently and optimised for different things. When I think in one language and mentally translate the code to the other, I’m exploiting the efficiencies of the thinking language rather than the efficiencies of the coding language.

Then, the translation process itself can be ugly. What might be one line of code in R can sometimes take 15 lines in Python (and vice versa). So I end up writing insanely verbose code that is hard to read.

Such code also looks ugly – a “native user” of the language finds it rather funnily written, and will find it hard to read.

A decade ago, after a year of struggling in Delhi, I packed my bags and moved back to Bangalore, where I could both think and speak in Kannada. Wonder what this implies in a programming context!

Language

For millions of years
Mankind lived
Just like the animals

And then something happened
That unleashed the power of our imagination
We learned to talk

(from Pink Floyd’s Keep Talking from Division Bell)

And then we moved to a place where no one speaks any of the languages you speak. And we became animals again.

This trip to Barcelona is the first time I’ve spent a reasonable length of time I’ve spent in a place where no one speaks any of the languages that I speak. And I’ve been literally feeling like an animal again, absolutely incapable of communicating, pointing at things and using sign language. It seems like my experience here has been significantly diminished given my inability to speak any of the languages spoken here.

I learnt to talk Kannada when I was perhaps one, or max two. I learnt English in a year or two after that. And then my language learning stopped. I had Hindi as my second language in school, and somehow struggled through it despite scoring 90 out of 100 in my board exam (shows how pointless board exams are). I can understand Hindi, and watch Hindi movies, but I still can’t speak fluently. When I have to speak Hindi, I construct a sentence in Kannada and then translate it. And I speak it with a heavy Kannada accent, much to the mirth of people around.

I have a Bihari cook in Bangalore. He claims to know Kannada  but I’ve never tried testing that. And I try speaking to him in Hindi. It is almost like we use sign language. I point to a set of ingredients and tell him the name of what I want to eat. He cooks, and buzzes off. At least talking face to face is fine. There are occasions when I have to call him and give him instructions (“come early tomorrow” or “come late today” or “don’t come today” or some such). It is a nightmare.

It’s not like I’m absolutely bad at languages – I can pick up words  quite easily. Thanks to football watching I’ve learnt a fair bit of European history and geography and culture, and through the process I’ve learnt a fair number of words (they’re of the kind of trequartistaregistatornante, etc but European words nevertheless). I know words in several languages. Just that I have this inability to learn grammar, or how words are put together to form sentences and communicate thoughts (except of course in English and Kannada).

Fourteen years back I went to IIT Madras, and half the people in my class were Gult. That meant I had the opportunity to pick up a fair bit of both Telugu and Tamil. I did neither. I can understand both languages a fair bit, but my understanding of the languages can be described as “assembly language”. I know words and what they mean. I listen for such keywords in what people are saying and interpret based on that. And when I speak these languages, it is based on keywords – I just say out the noun and the root form of the verb and expect the other person to interpret. I’ve never managed to get beyond this!

So there are these bakeries near where I live which might have already marked me off as a weird animal who just walks in and out o them. I go in, survey what they have and if something looks interesting point to that. They pack it for me, and then tell a number. I ask for the bill – so that I can read the number, or just give them a large enough note and trust them to return me the exact change. When nothing looks interesting to me in the display I can’t talk and ask them for what I want. I just look around (perhaps like a bakery dog) and just walk away. I don’t know how to say “Sorry I don’t know what I want”, or “Thank you, but I don’t find anything interesting here”. And I’ve been visiting some of these places multiple times, doing the same thing!

The level of discourse we are reduced to when we are unable to communicate is rather remarkable! It’s like we can simply not unleash the power of imagination, it is like going back to living like animals. I don’t like it, but I don’t know how to remedy it – I simply can’t pick up new languages!

Bangalore Book Festival

So today I made my way to Gayatri Vihar in the Palace Grounds to visit the Bangalore Book Festival, on its last day. It was interesting, though a bit crowded (what would you expect on the last day of an exhibition? and that too, when it’s a Sunday?). I didn’t buy much (just picked up two books) given the massive unread pile that lies at home. However, there was much scope for pertinent observations. Like I always do when I have a large number of unrelated pertinent observations, I’ll write this in bullet point form.

  • There were some 200 stalls. Actually, there might have been more. I didn’t keep count, despite the stalls having been numbered. Yeah, you can say that I wasn’t very observant.
  • All the major bookshops in Bangalore barring the multicity ones had set up shop there. I don’t really know what they were doing there. Or were they just trying to capture the market that only buys in fairs? Or did they set up stall there just to advertise themselves?
  • It seems like a lot of shops were trying to use the fair to get rid of inventory they wanted to discard. All they had to do was to stack all of this on one table and put a common price tag (say Rs. 50) on every book in that collection, and it was enough to draw insane crowds
  • One interesting stall at the fair had been set up by pothi.com an online self-publishing company. I’ll probably check them out sometime next year when I might want to publish a blook. Seems like an interesting business model they’ve got. Print on demand!
  • I also met the flipkart.com guys at the fair. Once again, they were there for advertising themselves. Need to check them out sometime. Given the kind of books I buy, I think online is the best place to get long tail stuff.
  • There was an incredibly large number of islamic publishing houses at the fair! And have you guys seen the “want qur an? call 98xxxxxxxx for free copy” hoardings all over the city? Wonder why the Bajrang Dal doesn’t target those
  • There was large vernacular presence at the fair. I remember reading in the papers that there was a quota for Kannada publishers, but there was reasonable presence for other languages also, like Gult, Tam, Mellu, Hindi
  • A large number of stalls were ideology driven. Publishing houses attached to cults had set up stalls, probably to further the cause of their own cult. So there was an ISKCON stall, a Ramakrishna Mutt stall, a Ramana Maharshi stall, etc.
  • Attendance at most of these niche stalls was quite thin, as people mostly crowded the stalls being run by bookstores in order to hunt for bargains. Attendance was also mostly thin at publisher-run stalls, making me wonder why most of these people had bothered to come to the fair at all.
  • I saw one awesomely funny banner at the place. It was by “Dr Partha Bagchi, the world leader in stammering for last 20 years” or some such thing. Was too lazy to pull out my phone and click pic. But it was a masterpiece of a banner
  • Another interesting ideological publisher there was “Leftword books”. Their two sales reps were in kurtas and carrying jholas (ok I made the latter part up). And they were sellling all sorts of left-wing books. Wonder who funds them! And they were also selling posters of Che for 10 bucks each
  • I wonder what impact this fair will have on bookstores in Bangalore in the next few days. Or probably it was mostly the non-regular book buyers who did business at the fair and so the regulars will be back at their favourite shops tomorrow.

I bought two books. Vedam Jaishankar’s Casting A Spell: A history of Karnataka cricket (I got it at Rs. 200, as opposed to a list price of Rs 500) and Ravi Vasudevan’s “Making Meaning in Indian Cinema”.

Search Phrases – February 2009

I don’t plan to make this a monthly feature, but will write this whenever I find enough funny search phrases to make a post on  them worth it. Googlers and google seem to have had a field day this month,

The top search phrase that has led to my blog is of course “noenthuda“. In second place is the fairly boring “blog.noenthuda.com” .  Third place is extremely interesting – top reasons marriage engagements break in pakistan. And I’ve got over 50 people who have searched for this phrase in the last month and then landed up at my blog! Now it makes me wonder what the top reasons are for marriage engagements breaking in pakistan.

Here are a few other gems from the month gone by.

  • gay in iimb (17 hits)
  • 3-letter word for pertinent
  • aunties in chickballapur (chickballapur is my father’s native place, for the record; it is famous for its extremely spicy chillies)
  • best english speaking course in north india
  • can we put the shoes and chappals near the entrance of the house
  • cricketers animal names
  • funny message for my cousin who wants to move back to bangalore
  • i am working in singapore what do i need to do to buy a car in delhi
  • i don’t know how to speak english but i know hindi can i work in delhi
  • iimb course to be on your own
  • job interview edition on savitabhabhi.com
  • karwar muslims
  • matha amritha, things she does
  • number of north indians settled in south india
  • societal influence on a bastard child
  • the true story of a man who learnt fluent spoken english
  • which indian breakfast item can be made with bread?

Ok that has been a very long list indeed. Much longer than I intended it to be. But it only reflects the brilliance of googlers and google in the last one month.

why is the level of English in North India so low?

I had sent this mail to a mailing list of 60-odd super-intelligent people. unfortunately, in their fondness for Savita Bhabhi, Vidarbhan farmers and child-eating, they weren’t able to come up with any convincing explanation for this. So I thought you super-intelligent readers of my blog might be able to help. I begin.

Three months back I moved to Gurgaon from Bangalore. And one thing I’ve noticed is that here practically no one can speak English. I’m referring to service providers here, people who are typically from the lower middle class. Taxi driver. Electrician. Waiter. Accountant. etc.

None of them can speak a word of English, and  I mean that almost literally. In Bangalore and Madras, we can see that people in these professions at least make an effort to speak English, and even if you don’t know their local tongue you will be able to communicate with them and get your work done. Here, unless you know Hindi, it is impossible. There is only so much you can communicate in Dumb Charades, right?

I suppose one argument will be that people in the North would have never had the need to learn English since most people they come across can speak Hindi. And that since linguistic regions are much smaller in the South, there is greater incentive for people to pick up and learn new languages. And since they know that a knowledge of English helps get them more business, they make an effort to pick it up.

But again – even if you exclude those who haven’t gone to school, the knowledge of English here is horrible. Isn’t it aspirational in North India to send kids to English medium schools? If not, I wonder why this is the case – given that in the South practically everyone want to send their kids to English medium schools.

Ok here is my hypothesis – remember that it is a hypothesis and not an argument. I wonder if people who are native of regions where the same language prevails over a large geographical area are linguistically challenged. because everyone they need to interact with know their language and there is no need for them to learn any new language. and this affects their ability to pick up new languages. on the other hand, people from linguistically diverse regions will tend to find it easier to pick up new languages.

extending this, it might actually help if the medium of instruction in your school is not your native tongue. having learnt a new language early, you will find it easier to pick up new languages as you go along.

sometime last month I was at a high-end restaurant with a couple of friends. spoke to the waiter in English and he didn’t understand. one of my friends who was with me said “don’t bother talking to these guys in English. if they knew some english, they’d’ve been working for Genpact and not become waiters”