Wednesday, 18 October 2017

how to know the version of tensorflow - Mac - terminal

Type the below command in terminal

python3 -c 'import tensorflow as tf; print(tf.__version__)'

Wednesday, 2 August 2017

config not found | Shakesphere - LSTM | init_py_ error

Error:


from app.views import net
  File "/Users/zuni/Documents/hbku/Research/shakespeare-LSTM-master/app/__init__.py", line 9, in <module>
    app.config.from_object('config')

  File "/Users/zuni/miniconda2/lib/python2.7/site-packages/flask/config.py", line 168, in from_object

.....

- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;

Debugged import:

- 'config' not found.

Solution:

Thursday, 6 July 2017

How to push a project to github from Android Studio

1. Create a repository on github in your account
2. Open mac terminal and go to the path where your repository is:
3. Type git branch
4. Choose the git branch that you want to move from your android studio and type the command below
      git push -u origin origine/master
5. Enter your git username when prompted
6. Enter your git password when prompted
7. Wait.... and it will be done.
8. Check on your github account under the repository name you chose.

Thursday, 25 May 2017

Error: Default Activity Not Found

Whenever we run the android studio project on startup we get the the error running app: Default activity not found

This is resolved by doing this:

1. Go to AndroidManifest.xml file (press shift twice and enter the file name to search it in android studio)

2. Add this code:

<activity    android:name="com.your.package.name.YourActivity"    android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

3. Go build.gradle add this code
sourceSets {
    main.java.srcDirs += 'src/main/<YOUR DIRECTORY>'}
Another easy way to solve the issue is:
When you import the android project use the steps below:
1. Download the git package using download zip
2. In android studio use Import from git
3. Direct to the directory where your project is saved and select the project folder
4. In the next step use import using manual gradle steps
5. Select empty Activity
6. Once it imports go to file>New>project
7. It will sync the project and make it an android project showing up gradle files in the 
   android select view.

Thursday, 20 April 2017

plotly not the same for python/pycharm and the jupyter

Use this command below to install the plotly to work with jupyter

conda install -c https://conda.anaconda.org/plotly plotly

Thursday, 30 March 2017

Cannot reiindex in python

all_data = pd.concat((train.loc[:,'MSSubClass':'SaleCondition'], test.loc[:,'MSSubClass':'SaleCondition']),ignore_index=True)

Just add ",ignore_index=True" at the end. This should solve the issue

Monday, 27 March 2017

How to replace one column with the median values of the other column by grouping in python

X.loc[X.LotFrontage.isnull(), 'LotFrontage'] = X.groupby('Neighborhood').LotFrontage.transform('median')


X = the dataset name
LotFrontage = The column that has NA's
Neighborhood = The column that is to be used for grouping
median = can be replaced by mean etc...