I am creating a system in order to predict earthquakes. There's this code in which there is a line %config InlineBackend.figure_format = 'retina'
.
Whenever I run my python code it gives the error as ("% invalid syntax")
.
Earlier I had the problem of %matplotlib
statement which I figured out through google. But, this problem is sucking me.
https://www.kaggle.com/pablocastilla/predict-earthquakes-with-lstm ("The source from where the code has been taken")
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from subprocess import check_output
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from sklearn.cross_validation import train_test_split
import time #helper libraries
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
from numpy import newaxis
from geopy.geocoders import Nominatim
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
import warnings
warnings.filterwarnings('ignore')
%config InlineBackend.figure_format = 'retina'
# Any results you write to the current directory are saved as output.
from subprocess import check_output
print(check_output(["ls", "../input"]).decode("utf8"))
So it is showing "error invalid syntax
" and the %
sign before the word config has been highlighted.
The expected output is that I should not recieve an error and any results that are written to the directory are given out.