Featured Post

Python map() and lambda() Use Cases and Examples

Image
 In Python, map() and lambda functions are often used together for functional programming. Here are some examples to illustrate how they work. Python map and lambda top use cases 1. Using map() with lambda The map() function applies a given function to all items in an iterable (like a list) and returns a map object (which can be converted to a list). Example: Doubling Numbers numbers = [ 1 , 2 , 3 , 4 , 5 ] doubled = list ( map ( lambda x: x * 2 , numbers)) print (doubled) # Output: [2, 4, 6, 8, 10] 2. Using map() to Convert Data Types Example: Converting Strings to Integers string_numbers = [ "1" , "2" , "3" , "4" , "5" ] integers = list ( map ( lambda x: int (x), string_numbers)) print (integers) # Output: [1, 2, 3, 4, 5] 3. Using map() with Multiple Iterables You can also use map() with more than one iterable. The lambda function can take multiple arguments. Example: Adding Two Lists Element-wise list1 = [ 1 , 2 , 3 ]

Why MySQL You Need to Master for Data Analytics Jobs

Relational databases all use SQL as the domain-specific language for ad hoc queries
MySQL
Before you can start analysing data, you are going to actually have to have some data on hand. That means a database – preferably a relational one.

If you had your sights set on a non-relational, NoSQL database solution, you might want to step back and catch your breath. NoSQL databases are unique because of their independence from the Structured Query Language (SQL) found in relational databases.

Relational databases all use SQL as the domain-specific language for ad hoc queries, whereas non-relational databases have no such standard query language, so they can use whatever they want –including SQL. Non-relational databases also have their own APIs designed for maximum scalability and flexibility.

When You Need to Learn NoSQL Databases?

NoSQL databases are typically designed to excel in two specific areas: speed and scalability. But for the purposes of learning about data concepts and analysis, such super-powerful tools are pretty much overkill. In other words, you need to walk before you can run.
However, if you are just starting out, don’t worry – there’s plenty to learn. By far the most common open source database is MySQL, which is now owned by Oracle. MySQL is ubiquitous on the Internet: The standard web server run by over 65 percent of all websites uses what’s known as a

  • LAMP stack – the “M” of which stands for MySQL. MySQL epitomizes simplicity, too. Skilled data jockeys can use the command line to construct databases and queries with blinding speed. If command lines are a bit steep, then I recommend you install a copy of MySQL Workbench, which is available from the MySQL site free of charge. Workbench enables you to manage MySQL databases visually, making it much easier to explore your data. On the basis of how you feel about Oracle, you might not be too thrilled to give even the venerable MySQL a try. Fortunately, you have some robust alternatives:
  • MariaDB - is the community fork of MySQL founded and developed by Monty Widenius, the founder of MySQL. MariaDB is designed to be highly compatible with MySQL, so you can just replace MySQL with MariaDB instantly, if you want
  • Drizzle - Whereas MariaDB has tried to remain true to MySQL, Drizzle, another community fork, has decided to improve on MySQL radically. Learning Drizzle is a bit different from MySQL, but not so much that you couldn’t migrate back and forth.

How to Install MySQL WorkBench?

To install your own instance of a database, it is recommended you use your distribution’s packages first, to ensure they are tested and all dependencies are checked. Updated packages are available at the sites linked above if your distro doesn’t have a set of these database packages in its repositories.
Naturally, you’re going to want to populate your database with some data – or at least some data with which to experiment.

The MySQL developers are more than aware of this, and have posted up some handy sample databases to start using. Of course, my personal favorite database is the Lahman Baseball Database. Even if you’re not a baseball fan, there’s plenty of rich data in this database to keep you analyzing for months.

To load the database with the use of MySQL Workbench, click the New Server Instance link and connect to localhost. Once that operation is complete, click the Manage Import/Export link to use the Import/Export MySQL Data Wizard to locate the *.sql file you have downloaded (and extracted if necessary) and connect it to the Workbench. Once you have the database loaded, you can use the Workbench application to manage the tables and queries as you need.

Comments

Popular posts from this blog

How to Fix datetime Import Error in Python Quickly

SQL Query: 3 Methods for Calculating Cumulative SUM

Python placeholder '_' Perfect Way to Use it