karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 134 of 143

Exploratory Data Analysis in Python

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 3K+ Views

For data analysis, Exploratory Data Analysis (EDA) must be your first step. Exploratory Data Analysis helps us to −To give insight into a data set.Understand the underlying structure.Extract important parameters and relationships that hold between them.Test underlying assumptions.Understanding EDA using sample Data setTo understand EDA using python, we can take the sample data either directly from any website or from your local disk. I’m taking the sample data from the UCI Machine Learning Repository which is publicly available of a red variant of Wine Quality data set and try to grab much insight into the data set using EDA.import pandas ...

Read More

Create MySQL column with Key=MUL?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 6K+ Views

You need to use ADD KEY to make a column with Key=MUL. The syntax is as follows −ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type, ADD KEY(yourColumnName);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table Instructor    -> (    -> Instructor_Id int,    -> Instructor_Name varchar(30),    -> Instructor_CourseName varchar(100)    -> ); Query OK, 0 rows affected (0.63 sec)Now you can look the table description of the table, the column KEY does not have any MUL key. The query is as follows to check the ...

Read More

Get the type of a variable in MySQL?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 1K+ Views

You cannot get the type of variable in MySQL. Cast the type of variable into another using CAST operator. The syntax is as follows −SET @yourVariableName:=’anyValue’Use the CAST operator to cast to another type. The syntax is as follows −SELECT CAST( @yourVariableName AS SIGNED);To understand the above syntax, let us cast to another type.Case 1: String to unsigned −mysql> set @StringToInt:='12345'; Query OK, 0 rows affected (0.00 sec)The query is as follows to another type −mysql> select CAST(@StringToInt as UNSIGNED);The following is the output −+--------------------------------+ | CAST(@StringToInt as UNSIGNED) | +--------------------------------+ | 12345               ...

Read More

Implementation of Dynamic Array in Python

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 14K+ Views

Dynamic ArrayIn python, a list, set and dictionary are mutable objects. While number, string, and tuple are immutable objects. Mutable objects mean that we add/delete items from the list, set or dictionary however, that is not true in case of immutable objects like tuple or strings.In python, a list is a dynamic array. Let's try to create a dynamic list −>>> #Create an empty list, named list1 >>> list1 = [] >>> type (list1) Add some items onto our empty list, list1 −>>> # Add items >>> list1 =[2, 4, 6] >>> list1 [2, 4, 6] >>> # Another way ...

Read More

Python program to print all the numbers divisible by 3 and 5 for a given number

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 20K+ Views

This is a python program to print all the numbers which are divisible by 3 and 5 from a given interger N. There are numerous ways we can write this program except that we need to check if the number is fully divisble by both 3 and 5.Below is my code to write a python program to print all the numbers divisible by 3 and 5 −lower = int(input("Enter lower range limit:")) upper = int(input("Enter upper range limit:")) for i in range(lower, upper+1):    if((i%3==0) & (i%5==0)):       print(i)OutputEnter lower range limit:0 Enter upper range limit:99 0 15 ...

Read More

Why is “LIMIT 0” even allowed in MySQL SELECT statements?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 1K+ Views

As you know if you use LIMIT 0 in MySQL SELECT statement, it returns an empty set.The LIMIT can be used when you want a specified number of rows from a result rather than the entire rows. If you use any MySQL API, then the job of LIMIT is to acquire the type of result columns.LIMIT 0 can be used to check the validity of a query. For more details use the following link −https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.htmlHere is the demo of LIMIT 0. The query to create a table is as follows −mysql> create table Limit0Demo    -> (    -> Id ...

Read More

MySQL update query to remove spaces?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 2K+ Views

You can use TRIM() function to remove spaces. The syntax is as follows −UPDATE yourTableName SET yourColumnName=TRIM(yourColumnName);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table removeSpaceDemo -> ( -> Id int NOT NULL AUTO_INCREMENT, -> UserId varchar(20), -> UserName varchar(10), -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into removeSpaceDemo(UserId, ...

Read More

MySQL query to group data in the form of user login time per hour and get the records of the users logged in the recent hour?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 360 Views

You can use a subquery with JOIN condition for this. The syntax is as follows −SELECT yourTablevariableName.* FROM ( SELECT MAX(UNIX_TIMESTAMP(yourDateTimeColumnName)) AS anyAliasName FROM getLatestHour GROUP BY HOUR(UserLoginDateTime) ) yourOuterVariableName JOIN yourTableName yourTablevariableName ON UNIX_TIMESTAMP(yourDateTimeColumnName) = yourOuterVariableName.yourAliasName WHERE DATE(yourDateTimeColumnName) = 'yourDateValue';To understand the above syntax and the result to be achieved, let us create a table. The query to create a table is as follows −mysql> create table getLatestHour -> ( -> UserId int, -> UserName varchar(20), -> UserLoginDateTime ...

Read More

How to set target and action for UIBarButtonItem at runtime?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 1K+ Views

To create a bar button action at run time we’ll need to go through a few steps. First of all let’s start by creating a new project.Once you have created the project, go to it’s storyboard directly, select the ViewController and Embed it into a navigation controller.Now go to the respective View controller class and inside it, we’ll perform some steps that will add a button to the navigation bar on run time.Create an objc function that should be called when the button is pressed.@objc func barButtonAction() {    print("Button pressed") }Now add the viewWillLayoutSubviews method to your class.First, we’ll ...

Read More

Can I change the size of UIActivityIndicator in Swift?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 843 Views

It is possible to change the size of UIActivityIndicator in swift using some tricks but it’s not recommended to change the size. To change the size of activity indicator let’s first add an indicator on an empty screen and see how it looks. For this example, I’ll also change the color to red.Let’s see how it looks when we run it without changing the size of the indicator.Now, we’ll create an outlet of activity indicator in our view controller and in the viewDidLoad method of this class we’ll add the code below.We’ll use CGAffineTransform to change the scale of our ...

Read More
Showing 1331–1340 of 1,421 articles
« Prev 1 132 133 134 135 136 143 Next »
Advertisements