Uncategorized

Resolving “ImportError: No module named pandas”

I installed Anaconda following instruction from “Learning pandas” by Michael Heydt

I also installed notebook for my Mac called  jupyter

but was unable to run their simplest code snippet:

import pandas as pd
df = pd.DataFrame.from_items([('column1', [1, 2, 3])])
print (df)

I was able to run it using my “in build” Python editor.

Resolution:

run in cmd

pip show –files pandas

use output returned in line for location:

In my case Location: /Users/me.me/anaconda/lib/python2.7/site-packages

To the top of the code snippet add the following:

import sys
import pandas as pd sys.path.insert(0,/Users/me.me/anaconda/lib/python2.7/site-packages'

df = pd.DataFrame.from_items([('column1', [1, 2, 3])])
print (df)

Sources:
https://python4astronomers.github.io/installation/packages.html

Advertisements
main_course

Mexican Lasagne

I was roaming the web for tasty vegetarian food to cook after work. As I work crazy hours I need nutritious food cooked fast!

I came across this interesting post on Mumsnet few days ago.

There was link to Bessies Veggie Food blog from which I tried Mexican Lasagne.

Kids loved it. No need for salt or more seasoning (however you could use chili or pepper if you like). I used Cheddar cheese and topped it up with Mozzarella leftovers. Extra portion gors to the freezer which hopefully man from JL delivers later this morning.

Ingredients

  • 2 tbsp olive oil
  • 2 onion, chopped
  • 2 red pepper, deseeded & chopped
  • 4 garlic cloves, finely chopped
  • 4 tsp cumin seeds
  • 1.5 tin tomatoes
  • 1.5 tin kidney beans/black beans
  • 2 small tin sweetcorn (Organic)
  • 100g (ish) grated cheese
  • tortilla wraps – I used 8 corn Tortilla Old El Paso

to serve

  • salad
  • avocado

Instructions

First, make the sauce

  1. Pre-heat the oven to 200C
  2. Heat the oil in a pan
  3. Add the onion & pepper
  4. Cover & cook for 7mins until tender but not browned
  5. Add the garlic & cumin seeds and cook for another 2-3mins
  6. Add the tomatoes & cook, uncovered for 15mins until thickWhile that cooks….
  7. Drain & mix the kidney beans & sweetcornWhen the sauce is ready:
  8. Spread some sauce on the bottom of an overproof dish
  9. Place a tortilla on top of the sauce
  10. Add a layer of beans & sweetcorn & scatter some cheese over the top
  11. Top with another tortilla and repeat the layering.
  12. Spread the last bit of sauce over the top of the last tortilla & sprinkle the remaining cheese over the top
  13. Bake for 30 minutes, and let it rest for 10-15mins before serving