How to load xlsb excel file into pandas dataframe in python 2.7 - python-2.x

How to load xlsb excel file into pandas dataframe in python 2.7
and a.xlsb file has sheet 1.xlsb how to access the sheet which is a.xlsb file

Related

How to make docx2pdf work on Google Colab to convert Docx to PDF automatically

I am getting following error when I tried to convert docx to PDF using docx2pdf imported from docx
Google colab code:
!pip install docx2pdf
from docx2pdf import convert as doc2pdf
doc2pdf('My_document.docx')
Present output:
docx2pdf is not implemented for linux as it requires Microsoft Word to be installed
If it cannot work, can you suggest another package that I can use to convert the docx to PDF on the Google colab automatically?

Pycharm doent recognize numpy package from previously created conda environment

im using Pycharm 2022.2.3.
I have Anaconda Navigator 2.3.2. Created in anaconda a new virtual environment based on python 2.7 called testpy2. Added the numpy package needed to execute a code. I did it from Ananconda Navigator GUI. The installation was succesful. I could see now numpy in my installed package list.
Open Pycharm project, select as interpreter the existing conda environment test2py.
The code is:
import random
import numpy as np
print "Hola"
The problem is it give the error: ImportError: DLL load failed when importing Numpy.
So I cant execute the program because of numpy.
When i go to see the packages something similar to:
then i got stuck in loading. Pycharm should recognize and load all the packages in the conda environemnt as shown in the image above, but in my case i got stuck in loading.
Im running on Windows 10 and i dont have any python installed at all
Any help would be apreciated.

Numpy and Pandas Not Working in Jupyter Notebook on Mac

I have both Python 2.7 and 3.6 working on my machine. Numpy and Pandas both load, for either version of Python, in the terminal. However, when I try to access them from inside Jupyter notebook, I get the following error messages:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-4ee716103900> in <module>()
----> 1 import numpy as np
ModuleNotFoundError: No module named 'numpy'
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-af55e7023913> in <module>()
----> 1 import pandas as pd
ModuleNotFoundError: No module named 'pandas'
Here is a screenshot of the problem as well:
If you look in the top right hand corner of the screenshot, you will notice where it says "Python3". I have seen video tutorials on Jupyter where clicking on that button generates a drop down list, allowing users to select alternate versions of Python. However, when I click on that button, nothing happens.
I noticed that a similar question was asked before here:
numpy & pandas 'ModuleNotFoundEror' in Jupyter notebook (Python 3)
However, very little information was provided and no resolution seems to have been found.
Another similar question provided a hint at an answer that was slightly more promising. It suggested running the following code both from terminal and from inside Jupyter, to make sure they match.
import sys; sys.executable
failed to import numpy as np when I worked with jupyter notebook
From terminal using Python 2.7.10>>
import sys; sys.executable
'/usr/bin/python'
From terminal using Python 3.6.1>>
import sys; sys.executable
'/usr/local/bin/python3'
From Jupyter>>
'/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6'
Have you checked this solution:
Failure to import numpy in Jupyter notebook ?
In your Jupyter screenshot, you're using a Python 3 kernel.
Make sure you have NumPy (and any others you might want to use) installed in your selected Python 3 environment.

Executing python script which depends on numpy and cv2

I'm executing python script in AWS lambda and I want to use numpy and cv2 in that python script. Is there a way to include numpy and cv2 into lambda zip package?
this blog post seems to answer your question.
python on aws lambda
Namely, its about creating a virtualenv and executing the python code from within that context.

Pandas .plot() call freezing GUI

I'm attempting to create graphs using pandas on Python 2.7 OSX 10.
import numpy as np
import pandas as pd
import Quandl
pd.options.display.mpl_style = 'default'
TOKEN = 'tWquoUMLCebqSBMbTFNg'
print 'Pandas Version', pd.__version__
print 'Numpy version', np.__version__
uk_df = Quandl.get('OECD/HEALTH_STAT_CICDHOCD_TXCMILTX_GBR', authtoken=TOKEN)
print uk_df.head(8)
uk_df.plot()
Output:
Pandas Version 0.12.0
Numpy version 1.8.0
…and then some data. The Python GUI spaceship attempts to open, but bounces forever. What am I missing here?
I have the latest matplotlib installed as well.

Resources